From b097d85dfe13ebb1e4e3144c47dbdaa19d205cfa Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Sun, 15 Sep 2024 12:40:05 -0400 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 PR-URL: https://github.com/nodejs/node/pull/54926 Refs: https://github.com/nodejs/node/issues/53382 Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca --- 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..2226ac93d283af 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(); })); });