[nginx] Fixed log action when using SSL certificates with variables.

Maxim Dounin mdounin at mdounin.ru
Mon May 24 15:24:44 UTC 2021


details:   https://hg.nginx.org/nginx/rev/1336a33cff33
branches:  
changeset: 7847:1336a33cff33
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon May 24 18:23:42 2021 +0300
description:
Fixed log action when using SSL certificates with variables.

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().

diffstat:

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

diffs (18 lines):

diff -r 2ab7b55ae4a0 -r 1336a33cff33 src/http/ngx_http_request.c
--- a/src/http/ngx_http_request.c	Thu May 20 19:59:16 2021 +0300
+++ b/src/http/ngx_http_request.c	Mon May 24 18:23:42 2021 +0300
@@ -1043,12 +1043,14 @@ ngx_http_ssl_certificate(ngx_ssl_conn_t 
     }
 
     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;
 }


More information about the nginx-devel mailing list