Skip to content

Commit ba340a0

Browse files
aduh95danielleadams
authored andcommitted
test: move test-tls-autoselectfamily-servername to test/internet
And switch from `google.com` to `nodejs.org`. PR-URL: #47029 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent ff94f9f commit ba340a0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const { addresses: { INET_HOST } } = require('../common/internet');
5+
6+
if (!common.hasCrypto) {
7+
common.skip('missing crypto');
8+
}
9+
10+
const { setDefaultAutoSelectFamilyAttemptTimeout } = require('net');
11+
const { connect } = require('tls');
12+
13+
// Some of the windows machines in the CI need more time to establish connection
14+
setDefaultAutoSelectFamilyAttemptTimeout(common.platformTimeout(common.isWindows ? 1500 : 250));
15+
16+
// Test that TLS connecting works without autoSelectFamily
17+
{
18+
const socket = connect({
19+
host: INET_HOST,
20+
port: 443,
21+
servername: INET_HOST,
22+
autoSelectFamily: false,
23+
});
24+
25+
socket.on('secureConnect', common.mustCall(() => socket.end()));
26+
}
27+
28+
// Test that TLS connecting works with autoSelectFamily
29+
{
30+
const socket = connect({
31+
host: INET_HOST,
32+
port: 443,
33+
servername: INET_HOST,
34+
autoSelectFamily: true,
35+
});
36+
37+
socket.on('secureConnect', common.mustCall(() => socket.end()));
38+
}

0 commit comments

Comments
 (0)