If no keyfile has been specified use the certificate file instead.
Fix typo: we need to check the chain is not NULL, not the chain file.
Reviewed-by: Matt Caswell <matt@openssl.org>
if (!exc->cert)
return 0;
if (exc->keyfile)
if (!exc->cert)
return 0;
if (exc->keyfile)
- exc->keyfile = exc->certfile;
- exc->key = load_key(err, exc->certfile, exc->certform, 0,
- NULL, NULL, "Server Certificate");
+ {
+ exc->key = load_key(err, exc->keyfile, exc->keyform,
+ 0, NULL, NULL, "Server Key");
+ }
+ else
+ {
+ exc->key = load_key(err, exc->certfile, exc->certform,
+ 0, NULL, NULL, "Server Key");
+ }
if (!exc->key)
return 0;
if (exc->chainfile)
if (!exc->key)
return 0;
if (exc->chainfile)
exc->chainfile, FORMAT_PEM,
NULL, NULL,
"Server Chain");
exc->chainfile, FORMAT_PEM,
NULL, NULL,
"Server Chain");