Mercurial > hg > nginx-tests
comparison stream_ssl_certificate.t @ 1619:436d0ffc2ea3
Tests: correctly shutdown ssl for reproducible session reuse tests.
Previously, session reuse tests in stream_ssl_certificate.t were prone
to testing errors, since the client doesn't write any application data
before closing a connection, which is done so to pass tests on win32.
In this case, the server may happened to get an unexpected eof meaning
that it will abandon that session. This is specific to stream testing
pattern, changes to ssl_certificate.t are applied too for consistency.
This is also specific to SSL_R_UNEXPECTED_EOF_WHILE_READING, which is
implemented in OpenSSL 3.0.0.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 23 Nov 2020 22:46:06 +0000 |
parents | cea0591b13dd |
children | 166461f0bd4b |
comparison
equal
deleted
inserted
replaced
1618:cea0591b13dd | 1619:436d0ffc2ea3 |
---|---|
180 | 180 |
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 Net::SSLeay::shutdown($ssl); | |
185 $s->close(); | 186 $s->close(); |
186 return $r unless wantarray(); | 187 return $r unless wantarray(); |
187 return ($s, $ssl); | 188 return ($s, $ssl); |
188 } | 189 } |
189 | 190 |