test: move test-tls-autoselectfamily-servername to test/internet

And switch from `google.com` to `nodejs.org`.

PR-URL: https://github.com/nodejs/node/pull/47029
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
Antoine du Hamel authored and Danielle Adams committed 2023-04-10 22:18:18 -04:00
1 parent ff94f9ffbe
commit ba340a0ddb
1 file changed
+38
@@ -0,0 +1,38 @@
'use strict';
const common = require('../common');
const { addresses: { INET_HOST } } = require('../common/internet');
if (!common.hasCrypto) {
common.skip('missing crypto');
}
const { setDefaultAutoSelectFamilyAttemptTimeout } = require('net');
const { connect } = require('tls');
// Some of the windows machines in the CI need more time to establish connection
setDefaultAutoSelectFamilyAttemptTimeout(common.platformTimeout(common.isWindows ? 1500 : 250));
// 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()));
}