Tests: fixed session reuse in ssl_sni.t with OpenSSL 1.1.0+.
See 3d312b6a1a19 for details.
diff --git a/ssl_sni.t b/ssl_sni.t
index de23fde..7a842e4 100644
--- a/ssl_sni.t
+++ b/ssl_sni.t
@@ -142,15 +142,14 @@
SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(),
SSL_session_cache_size => 100);
-like(http_get('/', socket => get_ssl_socket('localhost', 8081, $ctx)),
- qr/^\.:localhost$/m, 'ssl server name');
+like(get('/', 'localhost', 8081, $ctx), qr/^\.:localhost$/m, 'ssl server name');
TODO: {
local $TODO = 'not yet' if $t->has_module('OpenSSL (1.1.1|3)')
&& !$t->has_version('1.15.10');
-like(http_get('/', socket => get_ssl_socket('localhost', 8081, $ctx)),
- qr/^r:localhost$/m, 'ssl server name - reused');
+like(get('/', 'localhost', 8081, $ctx), qr/^r:localhost$/m,
+ 'ssl server name - reused');
}
@@ -202,4 +201,12 @@
EOF
}
+sub get {
+ my ($uri, $host, $port, $ctx) = @_;
+ my $s = get_ssl_socket($host, $port, $ctx) or return;
+ my $r = http_get($uri, socket => $s);
+ $s->close();
+ return $r;
+}
+
###############################################################################