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 <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54926
Refs: https://github.com/nodejs/node/issues/53382
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Michael Dawson authored and Richard Lau committed 2024-09-27 14:05:53 +00:00
1 parent e9997388a6
commit b097d85dfe
1 file changed
+5 -1
+5 -1
View File
@@ -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();
}));
});