Adapt key-manager to work with OpenSSL 1.1 preserving 1.0 compatibility