changeset 1675:0d1cec688111

Tests: logging ssl variables with lingering close.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 12 May 2021 12:50:55 +0300
parents 55816c5fc861
children 816d6ceefe50
files ssl.t
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ssl.t
+++ b/ssl.t
@@ -31,7 +31,7 @@ eval { IO::Socket::SSL::SSL_VERIFY_NONE(
 plan(skip_all => 'IO::Socket::SSL too old') if $@;
 
 my $t = Test::Nginx->new()->has(qw/http http_ssl rewrite proxy/)
-	->has_daemon('openssl')->plan(25);
+	->has_daemon('openssl')->plan(26);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -49,6 +49,8 @@ http {
     ssl_certificate localhost.crt;
     ssl_session_tickets off;
 
+    log_format ssl $ssl_protocol;
+
     server {
         listen       127.0.0.1:8085 ssl;
         listen       127.0.0.1:8080;
@@ -92,6 +94,8 @@ http {
         location /body {
             add_header X-Body $request_body always;
             proxy_pass http://127.0.0.1:8080/;
+
+            access_log %%TESTDIR%%/ssl.log ssl;
         }
     }
 
@@ -321,6 +325,16 @@ is(get_ssl_shutdown(8085), 1, 'ssl shutd
 
 }
 
+$t->stop();
+
+TODO: {
+local $TODO = 'not yet' if $t->has_version('1.19.5');
+
+like($t->read_file('ssl.log'), qr/^(TLS|SSL)v(\d|\.)+$/m,
+	'log ssl variable on lingering close');
+
+}
+
 ###############################################################################
 
 sub get {