File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments