mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 20:31:36 +00:00

* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
28 lines
672 B
JavaScript
28 lines
672 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const tls = require('tls');
|
|
const net = require('net');
|
|
|
|
const server = net.Server(common.mustCall(function(raw) {
|
|
const pair = tls.createSecurePair(null, true, false, false);
|
|
pair.on('error', function() {});
|
|
pair.ssl.setSNICallback(common.mustCall(function() {
|
|
raw.destroy();
|
|
server.close();
|
|
}));
|
|
require('_tls_legacy').pipe(pair, raw);
|
|
})).listen(0, function() {
|
|
tls.connect({
|
|
port: this.address().port,
|
|
rejectUnauthorized: false,
|
|
servername: 'server'
|
|
}, function() {
|
|
}).on('error', function() {
|
|
// Just ignore
|
|
});
|
|
});
|