You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
675 B

'use strict';
var common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
var tls = require('tls');
var net = require('net');
var server = net.Server(common.mustCall(function(raw) {
var 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
});
});