diff --git a/test/parallel/test-tls-dhe.js b/test/parallel/test-tls-dhe.js index 46779b09ff6b8f..21739ce42428eb 100644 --- a/test/parallel/test-tls-dhe.js +++ b/test/parallel/test-tls-dhe.js @@ -43,9 +43,12 @@ const dheCipher = 'DHE-RSA-AES128-SHA256'; const ecdheCipher = 'ECDHE-RSA-AES128-SHA256'; const ciphers = `${dheCipher}:${ecdheCipher}`; -// Test will emit a warning because the DH parameter size is < 2048 bits -common.expectWarning('SecurityWarning', - 'DH parameter is less than 2048 bits'); +if (!common.hasOpenSSL(3, 2)) { + // Test will emit a warning because the DH parameter size is < 2048 bits + // when the test is run on versions lower than OpenSSL32 + common.expectWarning('SecurityWarning', + 'DH parameter is less than 2048 bits'); +} function loadDHParam(n) { const keyname = `dh${n}.pem`; @@ -104,7 +107,11 @@ function testCustomParam(keylen, expectedCipher) { }, /DH parameter is less than 1024 bits/); // Custom DHE parameters are supported (but discouraged). - await testCustomParam(1024, dheCipher); + if (!common.hasOpenSSL(3, 2)) { + await testCustomParam(1024, dheCipher); + } else { + await testCustomParam(3072, dheCipher); + } await testCustomParam(2048, dheCipher); // Invalid DHE parameters are discarded. ECDHE remains enabled.