From caf74f3993ed37ce1359e0b10a64eacd9fffc0c1 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Fri, 13 Sep 2024 14:28:21 +0000 Subject: [PATCH] test: adjust test-tls-junk-server for OpenSSL32 Refs: #53382 OpenSSL32 returns different error text. Looking through the test it seems like the expected error text has been adjusted for different OpenSSL versions in the past and what the test is testing is not related to the error being returned. Update test to allow for error returned by OpenSSL32 Signed-off-by: Michael Dawson --- test/parallel/test-tls-junk-server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-tls-junk-server.js b/test/parallel/test-tls-junk-server.js index 273fe9def4ecb4..cc520383ede45f 100644 --- a/test/parallel/test-tls-junk-server.js +++ b/test/parallel/test-tls-junk-server.js @@ -20,8 +20,12 @@ server.listen(0, function() { const req = https.request({ port: this.address().port }); req.end(); + let expectedErrorMessage = new RegExp('wrong version number'); + if (common.hasOpenSSL(3, 2)) { + expectedErrorMessage = new RegExp('packet length too long'); + }; req.once('error', common.mustCall(function(err) { - assert(/wrong version number/.test(err.message)); + assert(expectedErrorMessage.test(err.message)); server.close(); })); });