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 <midawson@redhat.com>
PR-URL: #54926
Refs: #53382
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
mhdawson authored and targos committed Sep 22, 2024
1 parent 728f83d commit 8da8ff7
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 8da8ff7

Please sign in to comment.