mirror of
https://github.com/nodejs/node.git
synced 2025-05-11 06:33:06 +00:00

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>
28 lines
615 B
JavaScript
28 lines
615 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const https = require('https');
|
|
const net = require('net');
|
|
|
|
const server = net.createServer(function(s) {
|
|
s.once('data', function() {
|
|
s.end('I was waiting for you, hello!', function() {
|
|
s.destroy();
|
|
});
|
|
});
|
|
});
|
|
|
|
server.listen(0, function() {
|
|
const req = https.request({ port: this.address().port });
|
|
req.end();
|
|
|
|
req.once('error', common.mustCall(function(err) {
|
|
assert(/wrong version number/.test(err.message));
|
|
server.close();
|
|
}));
|
|
});
|