Skip to content

Commit ea41422

Browse files
committed
Tests: fixed session reuse in ssl_sni.t with OpenSSL 1.1.0+.
See 3d312b6a1a19 for details.
1 parent 3daf08a commit ea41422

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

ssl_sni.t

+11-4
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,14 @@ my $ctx = new IO::Socket::SSL::SSL_Context(
142142
SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(),
143143
SSL_session_cache_size => 100);
144144

145-
like(http_get('/', socket => get_ssl_socket('localhost', 8081, $ctx)),
146-
qr/^\.:localhost$/m, 'ssl server name');
145+
like(get('/', 'localhost', 8081, $ctx), qr/^\.:localhost$/m, 'ssl server name');
147146

148147
TODO: {
149148
local $TODO = 'not yet' if $t->has_module('OpenSSL (1.1.1|3)')
150149
&& !$t->has_version('1.15.10');
151150

152-
like(http_get('/', socket => get_ssl_socket('localhost', 8081, $ctx)),
153-
qr/^r:localhost$/m, 'ssl server name - reused');
151+
like(get('/', 'localhost', 8081, $ctx), qr/^r:localhost$/m,
152+
'ssl server name - reused');
154153

155154
}
156155

@@ -202,4 +201,12 @@ Host: $host
202201
EOF
203202
}
204203

204+
sub get {
205+
my ($uri, $host, $port, $ctx) = @_;
206+
my $s = get_ssl_socket($host, $port, $ctx) or return;
207+
my $r = http_get($uri, socket => $s);
208+
$s->close();
209+
return $r;
210+
}
211+
205212
###############################################################################

0 commit comments

Comments
 (0)