changeset 1450:5f53a1d6b83c

Tests: fixed session reuse in ssl_sni.t with OpenSSL 1.1.0+. See 3d312b6a1a19 for details.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 05 Mar 2019 17:47:07 +0300
parents eeababfd8726
children 9d579fc770a6
files ssl_sni.t
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ssl_sni.t
+++ b/ssl_sni.t
@@ -142,15 +142,14 @@ my $ctx = new IO::Socket::SSL::SSL_Conte
 	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 @@ Host: $host
 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;
+}
+
 ###############################################################################