comparison ssl_sni.t @ 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 f9718a0773b9
comparison
equal deleted inserted replaced
1449:eeababfd8726 1450:5f53a1d6b83c
140 140
141 my $ctx = new IO::Socket::SSL::SSL_Context( 141 my $ctx = new IO::Socket::SSL::SSL_Context(
142 SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(), 142 SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(),
143 SSL_session_cache_size => 100); 143 SSL_session_cache_size => 100);
144 144
145 like(http_get('/', socket => get_ssl_socket('localhost', 8081, $ctx)), 145 like(get('/', 'localhost', 8081, $ctx), qr/^\.:localhost$/m, 'ssl server name');
146 qr/^\.:localhost$/m, 'ssl server name');
147 146
148 TODO: { 147 TODO: {
149 local $TODO = 'not yet' if $t->has_module('OpenSSL (1.1.1|3)') 148 local $TODO = 'not yet' if $t->has_module('OpenSSL (1.1.1|3)')
150 && !$t->has_version('1.15.10'); 149 && !$t->has_version('1.15.10');
151 150
152 like(http_get('/', socket => get_ssl_socket('localhost', 8081, $ctx)), 151 like(get('/', 'localhost', 8081, $ctx), qr/^r:localhost$/m,
153 qr/^r:localhost$/m, 'ssl server name - reused'); 152 'ssl server name - reused');
154 153
155 } 154 }
156 155
157 ############################################################################### 156 ###############################################################################
158 157
200 Host: $host 199 Host: $host
201 200
202 EOF 201 EOF
203 } 202 }
204 203
205 ############################################################################### 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
212 ###############################################################################