changeset 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
files ssl_certificate.t stream_ssl_certificate.t
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ssl_certificate.t
+++ b/ssl_certificate.t
@@ -200,6 +200,7 @@ sub get {
 	my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return;
 	Net::SSLeay::write($ssl, 'GET / HTTP/1.0' . CRLF . CRLF);
 	my $r = Net::SSLeay::read($ssl);
+	Net::SSLeay::shutdown($ssl);
 	$s->close();
 	return $r unless wantarray();
 	return ($s, $ssl);
--- a/stream_ssl_certificate.t
+++ b/stream_ssl_certificate.t
@@ -182,6 +182,7 @@ sub get {
 	my ($host, $port, $ctx) = @_;
 	my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return;
 	my $r = Net::SSLeay::read($ssl);
+	Net::SSLeay::shutdown($ssl);
 	$s->close();
 	return $r unless wantarray();
 	return ($s, $ssl);