diff --git a/test/parallel/test-tls-junk-server.js b/test/parallel/test-tls-junk-server.js index 273fe9def4e..cc520383ede 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(); })); });