]> git.kaiwu.me - nginx.git/commitdiff
Stream: client SSL certificates were not checked with SNI
authorVadim Zhestikov <v.zhestikov@f5.com>
Wed, 14 Oct 2026 17:48:06 +0000 (10:48 -0700)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 11 Nov 2026 18:08:26 +0000 (22:08 +0400)
If the SSL handshake completed in the first call of
ngx_stream_ssl_handler(), the client certificate was verified using the
configuration of the default server, rather than the virtual server
selected by SNI during the handshake.

The problem appeared in d21675228 (1.25.5).  It is similar to the one
fixed in 620c9a4c4.

The fix is to re-read the server configuration before verifying the
client certificate.

Reported by CERT.PL.

src/stream/ngx_stream_ssl_module.c

index 0e17cff4d96eba8b0d6aa8b5b492311213ce7e1b..12e2d348b13f7b86d5da5ded31292396e4e8b7c0 100644 (file)
@@ -459,6 +459,8 @@ ngx_stream_ssl_handler(ngx_stream_session_t *s)
         }
     }
 
+    sscf = ngx_stream_get_module_srv_conf(s, ngx_stream_ssl_module);
+
     if (sscf->verify) {
         rc = SSL_get_verify_result(c->ssl->connection);