Mercurial > hg > nginx-tests
comparison stream_ssl_certificate.t @ 1618:cea0591b13dd
Tests: fixed TLSv1.3 session reuse in stream_ssl_certificate.t.
See 8b122b35703b for details. This is a missing part for stream tests.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 23 Nov 2020 22:46:04 +0000 |
parents | f3ba4c74de31 |
children | 436d0ffc2ea3 |
comparison
equal
deleted
inserted
replaced
1617:c56df3527161 | 1618:cea0591b13dd |
---|---|
157 | 157 |
158 like(get('password', 8083), qr/password/, 'ssl_password_file'); | 158 like(get('password', 8083), qr/password/, 'ssl_password_file'); |
159 | 159 |
160 # session reuse | 160 # session reuse |
161 | 161 |
162 my ($s, $ssl) = get_ssl_socket('default', 8080); | 162 my ($s, $ssl) = get('default', 8080); |
163 my $ses = Net::SSLeay::get_session($ssl); | 163 my $ses = Net::SSLeay::get_session($ssl); |
164 | 164 |
165 like(get('default', 8080, $ses), qr/:r/, 'session reused'); | 165 like(get('default', 8080, $ses), qr/:r/, 'session reused'); |
166 | 166 |
167 # do not check $ssl_server_name, since stream doesn't install SNI callback | 167 # do not check $ssl_server_name, since stream doesn't install SNI callback |
181 sub get { | 181 sub get { |
182 my ($host, $port, $ctx) = @_; | 182 my ($host, $port, $ctx) = @_; |
183 my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return; | 183 my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return; |
184 my $r = Net::SSLeay::read($ssl); | 184 my $r = Net::SSLeay::read($ssl); |
185 $s->close(); | 185 $s->close(); |
186 return $r; | 186 return $r unless wantarray(); |
187 return ($s, $ssl); | |
187 } | 188 } |
188 | 189 |
189 sub cert { | 190 sub cert { |
190 my ($host, $port, $ctx) = @_; | 191 my ($host, $port, $ctx) = @_; |
191 my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return; | 192 my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return; |