changeset 1841:db6fd9184fa0

Tests: fixed ssl_sni.t with LibreSSL and TLSv1.3. LibreSSL does not support session reuse with TLSv1.3.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 23 Mar 2023 19:50:15 +0300
parents 0381a0a212e1
children af47a0b348a5
files ssl_sni.t
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ssl_sni.t
+++ b/ssl_sni.t
@@ -148,9 +148,13 @@ my $ctx = new IO::Socket::SSL::SSL_Conte
 
 like(get('/', 'localhost', 8081, $ctx), qr/^\.:localhost$/m, 'ssl server name');
 
-SKIP: {
-skip 'no TLS 1.3 sessions', 1 if get('/protocol', 'localhost') =~ /TLSv1.3/
-	&& ($Net::SSLeay::VERSION < 1.88 || $IO::Socket::SSL::VERSION < 2.061);
+TODO: {
+local $TODO = 'no TLSv1.3 sessions, old Net::SSLeay'
+	if $Net::SSLeay::VERSION < 1.88 && test_tls13();
+local $TODO = 'no TLSv1.3 sessions, old IO::Socket::SSL'
+	if $IO::Socket::SSL::VERSION < 2.061 && test_tls13();
+local $TODO = 'no TLSv1.3 sessions in LibreSSL'
+	if $t->has_module('LibreSSL') && test_tls13();
 
 like(get('/', 'localhost', 8081, $ctx), qr/^r:localhost$/m,
 	'ssl server name - reused');
@@ -159,6 +163,10 @@ like(get('/', 'localhost', 8081, $ctx), 
 
 ###############################################################################
 
+sub test_tls13 {
+	get('/protocol', 'localhost') =~ /TLSv1.3/;
+}
+
 sub get_ssl_socket {
 	my ($host, $port, $ctx) = @_;
 	my $s;