[nginx] SSL: added verify callback to ngx_ssl_trusted_certificate().

Maxim Dounin mdounin at mdounin.ru
Wed Jun 3 16:22:42 UTC 2020


details:   https://hg.nginx.org/nginx/rev/699f6e55bbb4
branches:  
changeset: 7664:699f6e55bbb4
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Wed Jun 03 19:11:32 2020 +0300
description:
SSL: added verify callback to ngx_ssl_trusted_certificate().

This ensures that certificate verification is properly logged to debug
log during upstream server certificate verification.  This should help
with debugging various certificate issues.

diffstat:

 src/event/ngx_event_openssl.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 7cbf6389194b -r 699f6e55bbb4 src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c	Mon Jun 01 22:31:23 2020 +0300
+++ b/src/event/ngx_event_openssl.c	Wed Jun 03 19:11:32 2020 +0300
@@ -920,6 +920,8 @@ ngx_int_t
 ngx_ssl_trusted_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *cert,
     ngx_int_t depth)
 {
+    SSL_CTX_set_verify(ssl->ctx, SSL_VERIFY_PEER, ngx_ssl_verify_callback);
+
     SSL_CTX_set_verify_depth(ssl->ctx, depth);
 
     if (cert->len == 0) {


More information about the nginx-devel mailing list