[nginx-tests] Tests: guarded session ticket tests for old OpenSS...
Maxim Dounin
mdounin at mdounin.ru
Sun May 5 21:05:01 UTC 2024
details: http://freenginx.org/hg/nginx-tests/rev/ab45ee8011df
branches:
changeset: 1971:ab45ee8011df
user: Maxim Dounin <mdounin at mdounin.ru>
date: Mon May 06 00:03:16 2024 +0300
description:
Tests: guarded session ticket tests for old OpenSSL versions.
Much like SNI support, TLS session tickets are available starting with
OpenSSL 0.9.8f if TLS extensions support is explicitly configured, and
enabled by default since 0.9.8j. As such, SNI availability is checked
to ensure TLS extensions support is compiled in.
Additionally, the ssl_session_ticket_key.t tests for automatic ticket key
rotation, which uses session ticket key callback, as introduced in
OpenSSL 0.9.8h.
diffstat:
lib/Test/Nginx.pm | 1 +
mail_ssl_session_reuse.t | 6 ++++++
ssl_session_reuse.t | 6 ++++++
ssl_session_ticket_key.t | 4 +++-
stream_ssl_session_reuse.t | 6 ++++++
5 files changed, 22 insertions(+), 1 deletions(-)
diffs (83 lines):
diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm
--- a/lib/Test/Nginx.pm
+++ b/lib/Test/Nginx.pm
@@ -114,6 +114,7 @@ sub has_module($) {
my %regex = (
sni => 'TLS SNI support enabled',
+ tickets => 'TLS SNI support enabled',
mail => '--with-mail((?!\S)|=dynamic)',
flv => '--with-http_flv_module',
perl => '--with-http_perl_module',
diff --git a/mail_ssl_session_reuse.t b/mail_ssl_session_reuse.t
--- a/mail_ssl_session_reuse.t
+++ b/mail_ssl_session_reuse.t
@@ -143,7 +143,13 @@ local $TODO = 'no TLSv1.3 sessions in Li
local $TODO = 'no TLSv1.3 sessions in Net::SSLeay (LibreSSL)'
if Net::SSLeay::constant("LIBRESSL_VERSION_NUMBER") && test_tls13();
+TODO: {
+local $TODO = 'no session tickets' unless $t->has_module('tickets');
+
is(test_reuse(8993), 1, 'tickets reused');
+
+}
+
is(test_reuse(8994), 1, 'tickets and cache reused');
TODO: {
diff --git a/ssl_session_reuse.t b/ssl_session_reuse.t
--- a/ssl_session_reuse.t
+++ b/ssl_session_reuse.t
@@ -170,7 +170,13 @@ local $TODO = 'no TLSv1.3 sessions in Li
local $TODO = 'no TLSv1.3 sessions in Net::SSLeay (LibreSSL)'
if Net::SSLeay::constant("LIBRESSL_VERSION_NUMBER") && test_tls13();
+TODO: {
+local $TODO = 'no session tickets' unless $t->has_module('tickets');
+
is(test_reuse(8443), 1, 'tickets reused');
+
+}
+
is(test_reuse(8444), 1, 'tickets and cache reused');
TODO: {
diff --git a/ssl_session_ticket_key.t b/ssl_session_ticket_key.t
--- a/ssl_session_ticket_key.t
+++ b/ssl_session_ticket_key.t
@@ -27,7 +27,7 @@ plan(skip_all => 'Net::SSLeay version =>
eval { require IO::Socket::SSL; die if $IO::Socket::SSL::VERSION < 2.030; };
plan(skip_all => 'IO::Socket::SSL version => 2.030 required') if $@;
-my $t = Test::Nginx->new()->has(qw/http http_ssl socket_ssl/)
+my $t = Test::Nginx->new()->has(qw/http http_ssl tickets socket_ssl/)
->has_daemon('openssl')->plan(2)
->write_file_expand('nginx.conf', <<'EOF');
@@ -99,6 +99,8 @@ is(get_ticket_key_name(), $key, 'ticket
select undef, undef, undef, 2.5;
+local $TODO = 'no ticket key callback'
+ if $t->has_module('OpenSSL') and not $t->has_feature('openssl:0.9.8h');
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'
diff --git a/stream_ssl_session_reuse.t b/stream_ssl_session_reuse.t
--- a/stream_ssl_session_reuse.t
+++ b/stream_ssl_session_reuse.t
@@ -147,7 +147,13 @@ local $TODO = 'no TLSv1.3 sessions in Li
local $TODO = 'no TLSv1.3 sessions in Net::SSLeay (LibreSSL)'
if Net::SSLeay::constant("LIBRESSL_VERSION_NUMBER") && test_tls13();
+TODO: {
+local $TODO = 'no session tickets' unless $t->has_module('tickets');
+
is(test_reuse(8443), 1, 'tickets reused');
+
+}
+
is(test_reuse(8444), 1, 'tickets and cache reused');
TODO: {
More information about the nginx-devel
mailing list