From 2bbac60588ed1b4969bfa5d7a67f4ed636dc534d Mon Sep 17 00:00:00 2001 From: Alistair Smith Date: Wed, 14 May 2025 16:08:51 -0700 Subject: [PATCH] also passing --- .../test/parallel/test-tls-min-max-version.js | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/test/js/node/test/parallel/test-tls-min-max-version.js b/test/js/node/test/parallel/test-tls-min-max-version.js index 5c8e1010b4..7df51679b4 100644 --- a/test/js/node/test/parallel/test-tls-min-max-version.js +++ b/test/js/node/test/parallel/test-tls-min-max-version.js @@ -173,25 +173,25 @@ if (DEFAULT_MIN_VERSION === 'TLSv1.2') { // U, 'ERR_SSL_UNSUPPORTED_PROTOCOL', 'ERR_SSL_WRONG_VERSION_NUMBER'); } -// if (DEFAULT_MIN_VERSION === 'TLSv1.1') { -// test(U, U, 'TLSv1_1_method', U, U, 'SSLv23_method', 'TLSv1.1'); -// test(U, U, 'TLSv1_method', U, U, 'SSLv23_method', -// U, 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION', -// 'ERR_SSL_UNSUPPORTED_PROTOCOL'); -// test(U, U, 'SSLv23_method', U, U, 'TLSv1_1_method', 'TLSv1.1'); -// test(U, U, 'SSLv23_method', U, U, 'TLSv1_method', -// U, 'ERR_SSL_UNSUPPORTED_PROTOCOL', 'ERR_SSL_WRONG_VERSION_NUMBER'); -// } +if (DEFAULT_MIN_VERSION === 'TLSv1.1') { + test(U, U, 'TLSv1_1_method', U, U, 'SSLv23_method', 'TLSv1.1'); + test(U, U, 'TLSv1_method', U, U, 'SSLv23_method', + U, 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION', + 'ERR_SSL_UNSUPPORTED_PROTOCOL'); + test(U, U, 'SSLv23_method', U, U, 'TLSv1_1_method', 'TLSv1.1'); + test(U, U, 'SSLv23_method', U, U, 'TLSv1_method', + U, 'ERR_SSL_UNSUPPORTED_PROTOCOL', 'ERR_SSL_WRONG_VERSION_NUMBER'); +} -// if (DEFAULT_MIN_VERSION === 'TLSv1') { -// test(U, U, 'TLSv1_1_method', U, U, 'SSLv23_method', 'TLSv1.1'); -// test(U, U, 'TLSv1_method', U, U, 'SSLv23_method', 'TLSv1'); -// test(U, U, 'SSLv23_method', U, U, 'TLSv1_1_method', 'TLSv1.1'); -// test(U, U, 'SSLv23_method', U, U, 'TLSv1_method', 'TLSv1'); -// } +if (DEFAULT_MIN_VERSION === 'TLSv1') { + test(U, U, 'TLSv1_1_method', U, U, 'SSLv23_method', 'TLSv1.1'); + test(U, U, 'TLSv1_method', U, U, 'SSLv23_method', 'TLSv1'); + test(U, U, 'SSLv23_method', U, U, 'TLSv1_1_method', 'TLSv1.1'); + test(U, U, 'SSLv23_method', U, U, 'TLSv1_method', 'TLSv1'); +} -// // TLSv1 thru TLSv1.2 are only supported with explicit configuration with API or -// // CLI (--tls-v1.0 and --tls-v1.1). +// TLSv1 thru TLSv1.2 are only supported with explicit configuration with API or +// CLI (--tls-v1.0 and --tls-v1.1). test(U, U, 'TLSv1_2_method', U, U, 'TLSv1_2_method', 'TLSv1.2'); test(U, U, 'TLSv1_1_method', U, U, 'TLSv1_1_method', 'TLSv1.1'); test(U, U, 'TLSv1_method', U, U, 'TLSv1_method', 'TLSv1'); @@ -221,32 +221,32 @@ if (DEFAULT_MIN_VERSION === 'TLSv1.2') { } } -// // The default with --tls-v1.1. -// if (DEFAULT_MIN_VERSION === 'TLSv1.1') { -// test(U, U, 'TLSv1_1_method', U, U, U, 'TLSv1.1'); -// test(U, U, 'TLSv1_method', U, U, U, -// U, 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION', -// 'ERR_SSL_UNSUPPORTED_PROTOCOL'); -// test(U, U, U, U, U, 'TLSv1_1_method', 'TLSv1.1'); +// The default with --tls-v1.1. +if (DEFAULT_MIN_VERSION === 'TLSv1.1') { + test(U, U, 'TLSv1_1_method', U, U, U, 'TLSv1.1'); + test(U, U, 'TLSv1_method', U, U, U, + U, 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION', + 'ERR_SSL_UNSUPPORTED_PROTOCOL'); + test(U, U, U, U, U, 'TLSv1_1_method', 'TLSv1.1'); -// if (DEFAULT_MAX_VERSION === 'TLSv1.2') { -// test(U, U, U, U, U, 'TLSv1_method', -// U, 'ERR_SSL_UNSUPPORTED_PROTOCOL', 'ERR_SSL_WRONG_VERSION_NUMBER'); -// } else { -// // TLS1.3 client hellos are are not understood by TLS1.1 or below. -// test(U, U, U, U, U, 'TLSv1_method', -// U, 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION', -// 'ERR_SSL_UNSUPPORTED_PROTOCOL'); -// } -// } + if (DEFAULT_MAX_VERSION === 'TLSv1.2') { + test(U, U, U, U, U, 'TLSv1_method', + U, 'ERR_SSL_UNSUPPORTED_PROTOCOL', 'ERR_SSL_WRONG_VERSION_NUMBER'); + } else { + // TLS1.3 client hellos are are not understood by TLS1.1 or below. + test(U, U, U, U, U, 'TLSv1_method', + U, 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION', + 'ERR_SSL_UNSUPPORTED_PROTOCOL'); + } +} -// // The default with --tls-v1.0. -// if (DEFAULT_MIN_VERSION === 'TLSv1') { -// test(U, U, 'TLSv1_1_method', U, U, U, 'TLSv1.1'); -// test(U, U, 'TLSv1_method', U, U, U, 'TLSv1'); -// test(U, U, U, U, U, 'TLSv1_1_method', 'TLSv1.1'); -// test(U, U, U, U, U, 'TLSv1_method', 'TLSv1'); -// } +// The default with --tls-v1.0. +if (DEFAULT_MIN_VERSION === 'TLSv1') { + test(U, U, 'TLSv1_1_method', U, U, U, 'TLSv1.1'); + test(U, U, 'TLSv1_method', U, U, U, 'TLSv1'); + test(U, U, U, U, U, 'TLSv1_1_method', 'TLSv1.1'); + test(U, U, U, U, U, 'TLSv1_method', 'TLSv1'); +} // TLS min/max are respected when set with no secureProtocol. test('TLSv1', 'TLSv1.2', U, U, U, 'TLSv1_method', 'TLSv1');