]> git.kaiwu.me - nginx.git/commitdiff
Stream: client SSL certificates were not checked in some cases.
authorVladimir Homutov <vl@nginx.com>
Thu, 19 Jan 2017 13:20:07 +0000 (16:20 +0300)
committerVladimir Homutov <vl@nginx.com>
Thu, 19 Jan 2017 13:20:07 +0000 (16:20 +0300)
If ngx_stream_ssl_init_connection() succeeded immediately, the check was not
done.

The bug had appeared in 1.11.8 (41cb1b64561d).

src/stream/ngx_stream_ssl_module.c

index 414d32824ecbefd5740647ebeb1b07e34e5ce9bc..2f242b666c02399631c8c98e9fce8d432d960f42 100644 (file)
@@ -284,6 +284,7 @@ ngx_stream_ssl_handler(ngx_stream_session_t *s)
 {
     long                    rc;
     X509                   *cert;
+    ngx_int_t               rv;
     ngx_connection_t       *c;
     ngx_stream_ssl_conf_t  *sslcf;
 
@@ -305,7 +306,11 @@ ngx_stream_ssl_handler(ngx_stream_session_t *s)
             return NGX_ERROR;
         }
 
-        return ngx_stream_ssl_init_connection(&sslcf->ssl, c);
+        rv = ngx_stream_ssl_init_connection(&sslcf->ssl, c);
+
+        if (rv != NGX_OK) {
+            return rv;
+        }
     }
 
     if (sslcf->verify) {