Skip to content

Commit

Permalink
test: move test-tls-autoselectfamily-servername to test/internet
Browse files Browse the repository at this point in the history
And switch from `google.com` to `nodejs.org`.

PR-URL: #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>
  • Loading branch information
aduh95 authored and danielleadams committed Apr 11, 2023
1 parent ff94f9f commit ba340a0
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/internet/test-tls-autoselectfamily-servername.js
Original file line number Diff line number Diff line change
@@ -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()));
}

0 comments on commit ba340a0

Please sign in to comment.