diff ssl.t @ 1655:666d54ab5036

Tests: ssl_session_timeout fixes. The directive is moved to a distinct server block to avoid unexpected expirations. Actually provide SSL session (broken in c6f27bcdd9d9).
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 18 Feb 2021 13:52:47 +0300
parents 2f00ed2e0d1a
children 0d1cec688111
line wrap: on
line diff
--- a/ssl.t	Mon Feb 15 15:55:54 2021 +0300
+++ b/ssl.t	Thu Feb 18 13:52:47 2021 +0300
@@ -103,7 +103,6 @@
 
         ssl on;
         ssl_session_cache builtin;
-        ssl_session_timeout 1;
 
         location / {
             return 200 "body $ssl_session_reused";
@@ -142,6 +141,18 @@
             return 200 "body $ssl_session_reused";
         }
     }
+
+    server {
+        listen       127.0.0.1:8086 ssl;
+        server_name  localhost;
+
+        ssl_session_cache shared:SSL:1m;
+        ssl_session_timeout 1;
+
+        location / {
+            return 200 "body $ssl_session_reused";
+        }
+    }
 }
 
 EOF
@@ -256,9 +267,12 @@
 
 # session timeout
 
+$ctx = get_ssl_context();
+
+get('/', 8086, $ctx);
 select undef, undef, undef, 2.1;
 
-like(get('/', 8081), qr/^body \.$/m, 'session timeout');
+like(get('/', 8086, $ctx), qr/^body \.$/m, 'session timeout');
 
 # embedded variables