]> git.kaiwu.me - nginx.git/commitdiff
Fixed log action when using SSL certificates with variables.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 24 May 2021 15:23:42 +0000 (18:23 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 24 May 2021 15:23:42 +0000 (18:23 +0300)
When variables are used in ssl_certificate or ssl_certificate_key, a request
is created in the certificate callback to evaluate the variables, and then
freed.  Freeing it, however, updates c->log->action to "closing request",
resulting in confusing error messages like "client timed out ... while
closing request" when a client times out during the SSL handshake.

Fix is to restore c->log->action after calling ngx_http_free_request().

src/http/ngx_http_request.c

index 684fabdd61a87ddcf56cd5199662b6f6c31767c1..81b27a386ced6a2f1cfa4e8efd4f885693d8b505 100644 (file)
@@ -1043,12 +1043,14 @@ ngx_http_ssl_certificate(ngx_ssl_conn_t *ssl_conn, void *arg)
     }
 
     ngx_http_free_request(r, 0);
+    c->log->action = "SSL handshaking";
     c->destroyed = 0;
     return 1;
 
 failed:
 
     ngx_http_free_request(r, 0);
+    c->log->action = "SSL handshaking";
     c->destroyed = 0;
     return 0;
 }