mirror of
https://github.com/nginx/nginx.git
synced 2025-07-20 19:27:29 +08:00
SSL: Add SSL_CTX_check_private_key in ngx_ssl_certificate.
to resolve the issue which the config test passes unexpectedly in case of the key and cert is different the classes (RSA/DSA/ECDSA) in each.
This commit is contained in:
parent
d25139db01
commit
66d19c1a47
@ -553,6 +553,12 @@ ngx_ssl_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *cert,
|
||||
EVP_PKEY_free(pkey);
|
||||
return NGX_ERROR;
|
||||
}
|
||||
if (SSL_CTX_check_private_key(ssl->ctx) == 0) {
|
||||
ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
|
||||
"SSL_CTX_check_private_key(\"%s\") failed", key->data);
|
||||
EVP_PKEY_free(pkey);
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
EVP_PKEY_free(pkey);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user