# HG changeset patch # User Sergey Kandaurov # Date 1551797227 -10800 # Node ID 5f53a1d6b83c54c3e572791b14e79a7afd99fd59 # Parent eeababfd87269ff1353bb338ea51638aab66e465 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 --- 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; +} + ###############################################################################