Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
e66648e
esm: remove experimental status from JSON modules
MylesBorins May 17, 2019
1a8e67c
doc: simplify contributing documentation
Trott May 20, 2019
4716caa
tls: set tlsSocket.servername as early as possible
oyyd May 17, 2019
3b6424f
deps: histogram: unexport symbols
bnoordhuis May 23, 2019
c0cf173
src: ignore SIGXFSZ, don't terminate (ulimit -f)
bnoordhuis May 23, 2019
588fd0c
http, http2: flag for overriding server timeout
ofrobots May 14, 2019
8040d8b
test: increase debugging information on failure
Trott May 21, 2019
940577b
src: move ThreadPoolWork inlines into a -inl.h
sam-github May 22, 2019
02f794a
src: remove memory_tracker-inl.h from header files
sam-github May 17, 2019
d774ea5
src: remove env-inl.h from header files
sam-github May 17, 2019
530e63a
assert: remove unreachable code
Trott May 20, 2019
2b7ad12
n-api: DRY napi_coerce_to_x() API methods
bnoordhuis May 21, 2019
a9f9557
child_process: remove extra shallow copy
zero1five May 21, 2019
be1166f
esm: refactor createDynamicModule()
cjihrig May 22, 2019
a9a400e
test: update wpt/resources to e1fddfbf80
joyeecheung May 22, 2019
65d4f73
test: use ShellTestEnvironment in WPT
joyeecheung May 22, 2019
144db48
test: update wpt/url to 418f7fabeb
joyeecheung May 22, 2019
b54f3e0
tools: edit .eslintrc.js for minor maintainability improvements
Trott May 24, 2019
155b947
test: replace flag with option
Trott May 21, 2019
17abc8c
test: favor arrow functions for anonymous callbacks
Trott May 21, 2019
a4c1fd5
test: refactor test-https-agent-additional-options
Trott May 21, 2019
bfcbab4
test: fix test-https-agent-additional-options
Trott May 21, 2019
6981565
doc: edit stability index overview
Trott May 22, 2019
10e0d7f
tls: support the hints option
lpinca May 22, 2019
5bbc6d7
assert: remove unreachable code
Trott May 23, 2019
041b222
doc,n-api: fix typo in N-API introduction
richardlau May 23, 2019
08b0ca9
build,win: create junction instead of symlink to `out\%config%`
refack May 16, 2019
e3bb2ae
doc: remove experimental status for JSON documentation
Trott May 23, 2019
85f505c
doc: add version info for types
mhdawson May 17, 2019
e8fa067
tls: destroy trace BIO instead of leaking it
sam-github May 23, 2019
1da5acb
os: assume UTF-8 for hostname
addaleax May 24, 2019
34ef9e4
test: detect missing postmortem metadata
cjihrig May 22, 2019
9b90385
Revert "lib: print to stdout/stderr directly instead of using console"
richardlau May 22, 2019
263e533
doc: reposition "How to Contribute" README section
anish-94 May 22, 2019
9d9b32e
doc: fix for OutgoingMessage.prototype._headers/_headerNames
dnalborczyk May 6, 2019
44846ae
src: move DiagnosticFilename inlines into a -inl.h
sam-github May 22, 2019
7a7fc4e
doc: update n-api support matrix
teams2ua May 4, 2019
d99e703
inspector: implement --heap-prof
joyeecheung Apr 23, 2019
724d9c8
test: change expected and actual values in assert call
oksemonenko May 26, 2019
531669b
test: fix test-http2-multiheaders-raw
ShGKme May 26, 2019
f5bb1b3
test: switch actual value argument and expected in deepStrictEqual call
VetoS88 May 26, 2019
b83571d
test: add a test case for the path.posix.resolve
ShGKme May 26, 2019
e7966bc
test: unhardcode server port
MurkyMeow May 26, 2019
b117f6d
test: switch assertEqual arguments
zeckson May 26, 2019
728bc2f
tools: update dependencies in tools/doc
Trott May 27, 2019
652cadb
test: fix arguments order of comparsion functions
m0rtyn May 26, 2019
51ccdae
test: expect wpt/encoding/streams to fail
joyeecheung May 22, 2019
0f86c2b
test: run WPT in subdirectories
joyeecheung May 22, 2019
8fc6914
test: update wpt/encoding to 7287608f90
joyeecheung May 22, 2019
313077e
test: expect wpt/encoding/encodeInto.any.js to fail
joyeecheung May 22, 2019
8c35198
http2: support net.Server options
lpinca May 20, 2019
f621b8f
doc: reword Experimental stability index
Trott May 26, 2019
3ba354a
test: add test for util.inspect
Nievl May 26, 2019
6cd64c8
doc,test: clarify that Http2Stream is destroyed after data is read
mildsunrise May 26, 2019
2a509d4
test: switch assertEqual arguments
zeckson May 26, 2019
67b692b
test: add test case for checking typeof mgf1Hash
Nievl May 26, 2019
b7cd0de
doc: fix typo in pipe from async iterator example
lpinca May 25, 2019
83aaef8
http2: fix tracking received data for maxSessionMemory
addaleax May 26, 2019
0fe16ed
tls: group chunks into TLS segments
mildsunrise May 24, 2019
630cc3a
test: cover util.inspect on boxed primitive with colors
pinguinjkeke May 26, 2019
b5b234d
test: add testcase for SourceTextModule custom inspect
ch1ller0 May 26, 2019
512ab1f
inspector: removing checking of non existent field in lib/inspector.js
Keroosha May 26, 2019
b9cc407
src: make UNREACHABLE variadic
refack May 25, 2019
1a179e1
src: use ArrayBufferViewContents more frequently
addaleax May 26, 2019
a1788de
doc: adds link to nightly code coverage report
srcmake May 27, 2019
d982f0b
meta: create github support file
devsnek May 27, 2019
449ee8d
console: fix table() output
mscdex May 26, 2019
682319f
test: switch assertEqual arguments
zeckson May 26, 2019
6f9aa3f
test: add test cases for paramEncoding 'explicit'
oksemonenko May 26, 2019
6ca4f03
doc: revise additional Experimental status text
Trott May 28, 2019
25eb05a
lib: removed unnecessary fs.realpath `options` arg check + tests
opterion May 26, 2019
6548b91
tls: trace errors can show up as SSL errors
sam-github May 23, 2019
5eccd64
stream: convert existing buffer when calling .setEncoding
addaleax May 28, 2019
33236b7
src: export number_of_native_contexts and number_of_detached_contexts
May 28, 2019
9220a68
crypto: fix KeyObject handle type error message
pinguinjkeke May 26, 2019
0d74198
test: cover import of a *.node file with a policy manifest
zeckson May 26, 2019
d406785
src: unimplement deprecated v8-platform methods
targos May 25, 2019
0e1ce20
test: rsa-pss generateKeyPairSync invalid option hash
zeckson May 26, 2019
38e3827
test: add util inspect null getter test
mihan007 May 26, 2019
77ff597
doc: add missing --experimental-wasm-modules docs
cjihrig May 29, 2019
f4fc75d
doc: add missing status to DEP0121
cjihrig May 29, 2019
bab9f5a
doc: add information to revoked deprecations
cjihrig May 29, 2019
e72d4aa
errors: create internal connResetException
Trott May 29, 2019
a75a59d
tools: update inspector_protocol to 0aafd2
targos May 19, 2019
cc69d5a
doc,tools: get altDocs versions from CHANGELOG.md
richardlau May 12, 2019
6129376
test: add coverage for sparse array maxArrayLength
wentout May 30, 2019
c566401
doc: warn about relying on fs gc close behavior
benjamingr May 30, 2019
10bdd13
test: rename test-performance to test-perf-hooks
ryzokuken May 30, 2019
9b08c45
build,aix: link with `noerrmsg` to eliminate warnings
refack May 19, 2019
8b38dfb
http: call write callback even if there is no message body
lpinca May 20, 2019
799aeca
http2: respect inspect() depth
cjihrig May 30, 2019
11c3ddb
doc: simplify system call material in doc overview
Trott May 30, 2019
70b4854
doc: fix the wrong name of AssertionError
kyle7zhang May 30, 2019
24eaeed
http: fix socketOnWrap edge cases
apapirovski May 30, 2019
1865057
meta: correct personal info
refack May 28, 2019
d948656
http: fix deferToConnect comments
ronag May 26, 2019
89483be
inspector: more conservative minimum stack size
bnoordhuis May 24, 2019
c683cd9
doc: improve explanation for directory with fs.rename()
Trott Jun 2, 2019
9229825
test: covering destroying when worker already disconnected
Keroosha May 26, 2019
ef25ac5
doc: clarify wording in modules.md
Alex-Temny May 24, 2019
2ce24a9
tools: fix js2c regression
refack May 30, 2019
ea2d550
child_process: move exports to bottom for consistent code style
himself65 May 29, 2019
887dd60
test: simplify fs promises test
dnalborczyk Apr 15, 2019
a47ee80
stream: convert string to Buffer when calling `unshift(<string>)`
marcosc90 Apr 11, 2019
1827256
test: add coverage for unserializable worker thread error
Trott May 31, 2019
6a5ce36
test: handle unknown message type in worker threads
Trott May 31, 2019
23119ca
inspector: supported NodeRuntime domain in worker
alexkozy May 15, 2019
6421974
2019-06-04, Version 12.4.0 (Current)
targos Jun 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tls: support the hints option
Make `tls.connect()` support the `hints` option for feature parity with
`net.connect()`.

PR-URL: #27816
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
lpinca authored and targos committed May 28, 2019
commit 10e0d7f2acf1f82bde7d909d9d8979e2040f30e2
12 changes: 5 additions & 7 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,9 @@ being issued by trusted CA (`options.ca`).
<!-- YAML
added: v0.11.3
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/27816
description: The `hints` option is now supported.
- version: v12.2.0
pr-url: https://github.com/nodejs/node/pull/27497
description: The `enableTrace` option is now supported.
Expand Down Expand Up @@ -1248,13 +1251,9 @@ changes:
[`tls.createSecureContext()`][]. If a `secureContext` is _not_ provided, one
will be created by passing the entire `options` object to
`tls.createSecureContext()`.
* `lookup`: {Function} Custom lookup function. **Default:**
[`dns.lookup()`][].
* `timeout`: {number} If set and if a socket is created internally, will call
[`socket.setTimeout(timeout)`][] after the socket is created, but before it
starts the connection.
* ...: [`tls.createSecureContext()`][] options that are used if the
`secureContext` option is missing, otherwise they are ignored.
* ...: Any [`socket.connect()`][] option not already listed.
* `callback` {Function}
* Returns: {tls.TLSSocket}

Expand Down Expand Up @@ -1771,7 +1770,6 @@ where `secureSocket` has the same API as `pair.cleartext`.
[`--tls-cipher-list`]: cli.html#cli_tls_cipher_list_list
[`NODE_OPTIONS`]: cli.html#cli_node_options_options
[`crypto.getCurves()`]: crypto.html#crypto_crypto_getcurves
[`dns.lookup()`]: dns.html#dns_dns_lookup_hostname_options_callback
[`net.createServer()`]: net.html#net_net_createserver_options_connectionlistener
[`net.Server.address()`]: net.html#net_server_address
[`net.Server`]: net.html#net_class_net_server
Expand All @@ -1781,7 +1779,7 @@ where `secureSocket` has the same API as `pair.cleartext`.
[`server.getTicketKeys()`]: #tls_server_getticketkeys
[`server.listen()`]: net.html#net_server_listen
[`server.setTicketKeys()`]: #tls_server_setticketkeys_keys
[`socket.setTimeout(timeout)`]: #net_socket_settimeout_timeout_callback
[`socket.connect()`]: net.html#net_socket_connect_options_connectlistener
[`tls.DEFAULT_ECDH_CURVE`]: #tls_tls_default_ecdh_curve
[`tls.DEFAULT_MAX_VERSION`]: #tls_tls_default_max_version
[`tls.DEFAULT_MIN_VERSION`]: #tls_tls_default_min_version
Expand Down
14 changes: 2 additions & 12 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1420,23 +1420,13 @@ exports.connect = function connect(...args) {
tlssock.once('secureConnect', cb);

if (!options.socket) {
// If user provided the socket, its their responsibility to manage its
// If user provided the socket, it's their responsibility to manage its
// connectivity. If we created one internally, we connect it.
const connectOpt = {
path: options.path,
port: options.port,
host: options.host,
family: options.family,
localAddress: options.localAddress,
localPort: options.localPort,
lookup: options.lookup
};

if (options.timeout) {
tlssock.setTimeout(options.timeout);
}

tlssock.connect(connectOpt, tlssock._start);
tlssock.connect(options, tlssock._start);
}

tlssock._releaseControl();
Expand Down
26 changes: 26 additions & 0 deletions test/parallel/test-tls-connect-hints-option.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
});