Currently the sslpassword_program configuration parameter does not work
for encrypted certificate keys on ssl-bump enabled http ports, and user
always asked to give the SSL key password.
This patch fixes this problem.
This is a Measurement Factory project.
return certificate;
}
-EVP_PKEY * Ssl::readSslPrivateKey(char const * keyFilename)
+EVP_PKEY * Ssl::readSslPrivateKey(char const * keyFilename, pem_password_cb *passwd_callback)
{
if (!keyFilename)
return NULL;
return NULL;
if (!BIO_read_filename(bio.get(), keyFilename))
return NULL;
- EVP_PKEY *pkey = PEM_read_bio_PrivateKey(bio.get(), NULL, NULL, NULL);
+ EVP_PKEY *pkey = PEM_read_bio_PrivateKey(bio.get(), NULL, passwd_callback, NULL);
return pkey;
}
\ingroup SslCrtdSslAPI
* Read private key from file. Make sure that this is not encrypted file.
*/
-EVP_PKEY * readSslPrivateKey(char const * keyFilename);
+EVP_PKEY * readSslPrivateKey(char const * keyFilename, pem_password_cb *passwd_callback = NULL);
/**
\ingroup SslCrtdSslAPI
chain.reset(sk_X509_new_null());
if (!chain)
debugs(83, DBG_IMPORTANT, "WARNING: unable to allocate memory for cert chain");
- pkey.reset(readSslPrivateKey(keyFilename));
+ pkey.reset(readSslPrivateKey(keyFilename, ssl_ask_password_cb));
cert.reset(readSslX509CertificatesChain(certFilename, chain.get()));
if (!pkey || !cert || !X509_check_private_key(cert.get(), pkey.get())) {
pkey.reset(NULL);