This commit is contained in:
Y.Horie 2025-05-27 13:10:26 +03:00 committed by GitHub
commit 21af01e550
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -554,6 +554,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);