mirror of
https://github.com/nodejs/node.git
synced 2024-11-22 07:37:56 +01:00
8b51c1a869
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: https://github.com/nodejs/node/pull/46790 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
35 lines
728 B
JavaScript
35 lines
728 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const { addresses: { INET_HOST } } = require('../common/internet');
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('missing crypto');
|
|
}
|
|
|
|
const { connect } = require('tls');
|
|
|
|
// Test that TLS connecting works without autoSelectFamily
|
|
{
|
|
const socket = connect({
|
|
host: INET_HOST,
|
|
port: 443,
|
|
servername: INET_HOST,
|
|
autoSelectFamily: false,
|
|
});
|
|
|
|
socket.on('secureConnect', common.mustCall(() => socket.end()));
|
|
}
|
|
|
|
// Test that TLS connecting works with autoSelectFamily
|
|
{
|
|
const socket = connect({
|
|
host: INET_HOST,
|
|
port: 443,
|
|
servername: INET_HOST,
|
|
autoSelectFamily: true,
|
|
});
|
|
|
|
socket.on('secureConnect', common.mustCall(() => socket.end()));
|
|
}
|