changeset 1477:8b122b35703b

Tests: fixed session reuse tests in ssl_certificate.t with TLSv1.3. Previously, session data was retrieved too early, before server passed application data, which usually means NewSessionTicket is not yet sent. The fix is to ask server for application data, then retrieve a session.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 20 May 2019 16:00:40 +0300
parents e8ba4ae5e3ac
children f9718a0773b9
files ssl_certificate.t
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ssl_certificate.t
+++ b/ssl_certificate.t
@@ -180,7 +180,7 @@ like(get('password', 8083), qr/password/
 
 # session reuse
 
-my ($s, $ssl) = get_ssl_socket('default', 8080);
+my ($s, $ssl) = get('default', 8080);
 my $ses = Net::SSLeay::get_session($ssl);
 
 like(get('default', 8080, $ses), qr/default:r/, 'session reused');
@@ -201,7 +201,8 @@ sub get {
 	Net::SSLeay::write($ssl, 'GET / HTTP/1.0' . CRLF . CRLF);
 	my $r = Net::SSLeay::read($ssl);
 	$s->close();
-	return $r;
+	return $r unless wantarray();
+	return ($s, $ssl);
 }
 
 sub cert {