blob: fd155c9659ad0ca741c13f175b3a31aa9cb93c47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
'use strict';
const common = require('../common');
// This test verifies that `tls.connect()` honors the `hints` option.
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const dns = require('dns');
const tls = require('tls');
const hints = 512;
assert.notStrictEqual(hints, dns.ADDRCONFIG);
assert.notStrictEqual(hints, dns.V4MAPPED);
assert.notStrictEqual(hints, dns.ADDRCONFIG | dns.V4MAPPED);
tls.connect({
lookup: common.mustCall((host, options) => {
assert.strictEqual(host, 'localhost');
assert.deepStrictEqual(options, { family: undefined, hints });
}),
hints
});
|