mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: remove OpenSSL 1.0.2 error message compat
While upgrading from OpenSSL 1.0.2 to 1.1.1, these tests were modified to recognize error messages from both OpenSSL releases. Given that OpenSSL 1.0.2 has been unsupported for years, it is safe to remove the older message patterns. Refs: https://github.com/nodejs/node/pull/16130 PR-URL: https://github.com/nodejs/node/pull/46709 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
@@ -21,9 +21,7 @@ server.listen(0, function() {
|
||||
req.end();
|
||||
|
||||
req.once('error', common.mustCall(function(err) {
|
||||
// OpenSSL 1.0.x and 1.1.x use different error messages for junk inputs.
|
||||
assert(/unknown protocol/.test(err.message) ||
|
||||
/wrong version number/.test(err.message));
|
||||
assert(/wrong version number/.test(err.message));
|
||||
server.close();
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -42,8 +42,6 @@ process.on('exit', function() {
|
||||
common.printSkipMessage('`openssl s_client -ssl3` not supported.');
|
||||
} else {
|
||||
assert.strictEqual(errors.length, 1);
|
||||
// OpenSSL 1.0.x and 1.1.x report invalid client versions differently.
|
||||
assert(/:wrong version number/.test(errors[0].message) ||
|
||||
/:version too low/.test(errors[0].message));
|
||||
assert(/:version too low/.test(errors[0].message));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -20,9 +20,8 @@ const server = tls.createServer({})
|
||||
}).on('tlsClientError', common.mustCall(function(e) {
|
||||
assert.ok(e instanceof Error,
|
||||
'Instance of Error should be passed to error handler');
|
||||
// OpenSSL 1.0.x and 1.1.x use different error codes for junk inputs.
|
||||
assert.ok(
|
||||
/SSL routines:[^:]*:(unknown protocol|wrong version number)/.test(
|
||||
/SSL routines:[^:]*:wrong version number/.test(
|
||||
e.message),
|
||||
'Expecting SSL unknown protocol');
|
||||
|
||||
|
||||
@@ -20,9 +20,8 @@ const server = net.createServer(function(c) {
|
||||
s.on('error', common.mustCall(function(e) {
|
||||
assert.ok(e instanceof Error,
|
||||
'Instance of Error should be passed to error handler');
|
||||
// OpenSSL 1.0.x and 1.1.x use different error codes for junk inputs.
|
||||
assert.ok(
|
||||
/SSL routines:[^:]*:(unknown protocol|wrong version number)/.test(
|
||||
/SSL routines:[^:]*:wrong version number/.test(
|
||||
e.message),
|
||||
'Expecting SSL unknown protocol');
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user