1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

openssl: if cert type is ENG and no key specified, key is ENG too

Fixes #3692
Closes #3692
This commit is contained in:
David Woodhouse 2019-03-20 13:10:44 -07:00
parent 7550f62d07
commit efd9fba681

View File

@ -838,15 +838,15 @@ int cert_stuff(struct connectdata *conn,
return 0;
}
file_type = do_file_type(key_type);
if(!key_file)
key_file = cert_file;
else
file_type = do_file_type(key_type);
switch(file_type) {
case SSL_FILETYPE_PEM:
if(cert_done)
break;
if(!key_file)
/* cert & key can only be in PEM case in the same file */
key_file = cert_file;
/* FALLTHROUGH */
case SSL_FILETYPE_ASN1:
if(SSL_CTX_use_PrivateKey_file(ctx, key_file, file_type) != 1) {