Fix test runs on builds without tls1_3
authorFrederik Wedel-Heinen <frederik.wedel-heinen@dencrypt.dk>
Tue, 30 Jan 2024 13:29:53 +0000 (14:29 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 9 Feb 2024 08:16:56 +0000 (08:16 +0000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23319)

test/recipes/70-test_sslrecords.t

index a7d13c3abc82efb8ff5b139eac0a32fed9042859..8c95d48468d0cccdedae8149a5816f38d2110773 100644 (file)
@@ -41,6 +41,12 @@ my $proxy = TLSProxy::Proxy->new(
     (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
 
+# Avoid failures with tls1_3 disabled builds
+# TLSProxy defaults to use tls1_3 and tls1_2 is required by the tests so
+# set it here and check that a simple proxy works before running the tests
+$proxy->serverflags("-tls1_2");
+$proxy->clientflags("-no_tls1_3");
+
 $proxy->start() or plan skip_all => "Unable to start up Proxy for tests";
 plan tests => 42;
 
@@ -79,6 +85,7 @@ sub run_tests
     SKIP: {
         skip "Record tests not intended for dtls", 1 if $run_test_as_dtls == 1;
         #Test 1: Injecting out of context empty records should fail
+        $proxy->clear();
         $content_type = TLSProxy::Record::RT_APPLICATION_DATA;
         $inject_recs_num = 1;
         $fatal_alert = 0;