mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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:
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()));
|
||||
}
|
||||
Reference in new issue
Block a user