comparison 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 1b4ceab9cb1c
children fd440d324700
comparison
equal deleted inserted replaced
1618:cea0591b13dd 1619:436d0ffc2ea3
198 sub get { 198 sub get {
199 my ($host, $port, $ctx) = @_; 199 my ($host, $port, $ctx) = @_;
200 my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return; 200 my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return;
201 Net::SSLeay::write($ssl, 'GET / HTTP/1.0' . CRLF . CRLF); 201 Net::SSLeay::write($ssl, 'GET / HTTP/1.0' . CRLF . CRLF);
202 my $r = Net::SSLeay::read($ssl); 202 my $r = Net::SSLeay::read($ssl);
203 Net::SSLeay::shutdown($ssl);
203 $s->close(); 204 $s->close();
204 return $r unless wantarray(); 205 return $r unless wantarray();
205 return ($s, $ssl); 206 return ($s, $ssl);
206 } 207 }
207 208