[PATCH 17 of 20] Tests: fixed stream_ssl_variables.t.t with LibreSSL and TLSv1.3
Maxim Dounin
mdounin at mdounin.ru
Sat Mar 18 14:15:12 UTC 2023
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1679148849 -10800
# Sat Mar 18 17:14:09 2023 +0300
# Node ID fc68109603c10abff643444b39cf52daa240a3e2
# Parent 778dcba0f619808fef92999b174c86cf9668ffeb
Tests: fixed stream_ssl_variables.t.t with LibreSSL and TLSv1.3.
LibreSSL does not support session reuse with TLSv1.3.
diff --git a/stream_ssl_variables.t b/stream_ssl_variables.t
--- a/stream_ssl_variables.t
+++ b/stream_ssl_variables.t
@@ -101,11 +101,17 @@ is(stream('127.0.0.1:' . port(8080))->re
like(Net::SSLeay::read($ssl), qr/^\.:(\w{64})?:[\w-]+:(TLS|SSL)v(\d|\.)+$/,
'ssl variables');
+TODO: {
+local $TODO = 'no TLSv1.3 sessions in LibreSSL'
+ if $t->has_module('LibreSSL') && test_tls13();
+
my $ses = Net::SSLeay::get_session($ssl);
($s, $ssl) = get_ssl_socket(port(8081), $ses);
like(Net::SSLeay::read($ssl), qr/^r:(\w{64})?:[\w-]+:(TLS|SSL)v(\d|\.)+$/,
'ssl variables - session reused');
+}
+
SKIP: {
skip 'no sni', 3 unless $t->has_module('sni');
@@ -123,6 +129,11 @@ is(Net::SSLeay::ssl_read_all($ssl), '',
###############################################################################
+sub test_tls13 {
+ ($s, $ssl) = get_ssl_socket(port(8081));
+ Net::SSLeay::read($ssl) =~ /TLSv1.3/;
+}
+
sub get_ssl_socket {
my ($port, $ses, $name) = @_;
More information about the nginx-devel
mailing list