Skip to content

Commit

Permalink
test: adjust test-tls-junk-server for OpenSSL32
Browse files Browse the repository at this point in the history
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 <[email protected]>
PR-URL: #54926
Refs: #53382
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
mhdawson authored and richardlau committed Sep 27, 2024
1 parent e999738 commit b097d85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/parallel/test-tls-junk-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}));
});

0 comments on commit b097d85

Please sign in to comment.