mirror of
https://github.com/nodejs/node.git
synced 2024-11-22 07:37:56 +01:00
fddd3ffa59
PR-URL: https://github.com/nodejs/node/pull/48464 Fixes: https://github.com/npm/cli/issues/6409 Fixes: https://github.com/KararTY/dank-twitch-irc/issues/13 Fixes: https://github.com/nodejs/node/issues/47644 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
23 lines
648 B
JavaScript
23 lines
648 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const { addresses: { INET_HOST } } = require('../common/internet');
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('missing crypto');
|
|
}
|
|
|
|
const { Socket } = require('net');
|
|
const { TLSSocket } = require('tls');
|
|
|
|
// Test that TLS connecting works with autoSelectFamily when using a backing socket
|
|
{
|
|
const socket = new Socket();
|
|
const secureSocket = new TLSSocket(socket);
|
|
|
|
secureSocket.on('connect', common.mustCall(() => secureSocket.end()));
|
|
|
|
socket.connect({ host: INET_HOST, port: 443, servername: INET_HOST });
|
|
secureSocket.connect({ host: INET_HOST, port: 443, servername: INET_HOST });
|
|
}
|