node/doc/api
Sam Roberts 42dbaed460 tls: support TLSv1.3
This introduces TLS1.3 support and makes it the default max protocol,
but also supports CLI/NODE_OPTIONS switches to disable it if necessary.

TLS1.3 is a major update to the TLS protocol, with many security
enhancements. It should be preferred over TLS1.2 whenever possible.

TLS1.3 is different enough that even though the OpenSSL APIs are
technically API/ABI compatible, that when TLS1.3 is negotiated, the
timing of protocol records and of callbacks broke assumptions hard-coded
into the 'tls' module.

This change introduces no API incompatibilities when TLS1.2 is
negotiated. It is the intention that it be backported to current and LTS
release lines with the default maximum TLS protocol reset to 'TLSv1.2'.
This will allow users of those lines to explicitly enable TLS1.3 if they
want.

API incompatibilities between TLS1.2 and TLS1.3 are:

- Renegotiation is not supported by TLS1.3 protocol, attempts to call
`.renegotiate()` will always fail.

- Compiling against a system OpenSSL lower than 1.1.1 is no longer
supported (OpenSSL-1.1.0 used to be supported with configure flags).

- Variations of `conn.write('data'); conn.destroy()` have undefined
behaviour according to the streams API. They may or may not send the
'data', and may or may not cause a ERR_STREAM_DESTROYED error to be
emitted. This has always been true, but conditions under which the write
suceeds is slightly but observably different when TLS1.3 is negotiated
vs when TLS1.2 or below is negotiated.

- If TLS1.3 is negotiated, and a server calls `conn.end()` in its
'secureConnection' listener without any data being written, the client
will not receive session tickets (no 'session' events will be emitted,
and `conn.getSession()` will never return a resumable session).

- The return value of `conn.getSession()` API may not return a resumable
session if called right after the handshake. The effect will be that
clients using the legacy `getSession()` API will resume sessions if
TLS1.2 is negotiated, but will do full handshakes if TLS1.3 is
negotiated.  See https://github.com/nodejs/node/pull/25831 for more
information.

PR-URL: https://github.com/nodejs/node/pull/26209
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2019-03-20 07:48:25 -07:00
..
addons.md doc: hello addon example should return "world" 2019-03-05 23:54:31 +01:00
assert.md assert: adjust loose assertions 2019-01-27 03:34:25 +01:00
async_hooks.md async_hooks: remove deprecated emitBefore and emitAfter 2019-03-18 11:36:48 +01:00
buffer.md doc: make RFC references consistent 2019-03-17 23:14:20 -07:00
child_process.md doc: add Note of options.stdio into child_process 2019-03-19 07:35:37 +01:00
cli.md tls: support TLSv1.3 2019-03-20 07:48:25 -07:00
cluster.md benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
console.md 2019-01-17, Version 11.7.0 (Current), @BridgeAR 2019-01-18 14:03:19 +01:00
crypto.md crypto: add support for EdDSA key pair generation 2019-03-18 21:59:47 +01:00
debugger.md inspector: use js_app.html as the landing page for chrome devtools 2018-06-28 09:24:02 -03:00
deprecations.md doc: add missing pr-url 2019-03-19 05:57:44 +01:00
dgram.md benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
dns.md doc: make RFC references consistent 2019-03-17 23:14:20 -07:00
documentation.md doc: sort bottom-of-file markdown links 2018-11-28 13:09:31 -08:00
domain.md benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
errors.md 2019-03-15, Version 11.12.0 (Current) 2019-03-15 22:03:09 +01:00
esm.md doc: fix file extension on ESM file example 2019-01-27 13:26:50 +02:00
events.md events: add once method to use promises with EventEmitter 2019-03-02 19:17:45 +01:00
fs.md benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
globals.md lib: move queueMicrotask to stable 2019-03-08 08:19:38 -06:00
http2.md doc: make RFC references consistent 2019-03-17 23:14:20 -07:00
http.md doc: make RFC references consistent 2019-03-17 23:14:20 -07:00
https.md doc: add missing https Agent maxCachedSessions 2019-03-07 00:41:21 +01:00
index.md doc: add node-report documentation 2019-01-18 10:35:55 +05:30
inspector.md doc: add inspector API example for heapdump 2019-03-11 06:19:11 +01:00
intl.md doc: sort bottom-of-file markdown links 2018-11-28 13:09:31 -08:00
modules.md benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
n-api.md 2019-03-06, Version 11.11.0 (Current) 2019-03-06 20:24:50 +01:00
net.md benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
os.md doc: document os.userInfo() throwing SystemError 2019-02-03 13:44:06 +02:00
path.md doc,lib,test: capitalize comment sentences 2018-12-17 17:14:35 +01:00
perf_hooks.md benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
policy.md doc: fix metadata for v11.8.0 doc changes 2019-01-25 19:09:26 -08:00
process.md 2019-03-15, Version 11.12.0 (Current) 2019-03-15 22:03:09 +01:00
punycode.md doc: prevent some redirections 2018-07-14 22:57:03 +03:00
querystring.md doc: add decode() & encode() methods into querystring.md 2019-03-10 17:07:11 +02:00
readline.md benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
repl.md repl: add replDefaults to customize the writer 2019-03-08 04:44:56 +01:00
report.md report: use DiagnosticFilename for default filename 2019-03-15 20:48:38 -04:00
stream.md doc: document error event is optionally emitted after .destroy() 2019-03-19 21:33:52 +02:00
string_decoder.md string_decoder: support typed array or data view 2018-09-17 17:48:44 +02:00
synopsis.md doc: sort bottom-of-file markdown links 2018-11-28 13:09:31 -08:00
timers.md timers: truncate decimal values 2019-01-28 16:25:07 -08:00
tls.md tls: support TLSv1.3 2019-03-20 07:48:25 -07:00
tracing.md doc,lib,test: capitalize comment sentences 2018-12-17 17:14:35 +01:00
tty.md tty: add NO_COLOR and FORCE_COLOR support 2019-03-19 16:41:22 +01:00
url.md doc: list all versions WHATWG URL api was added 2018-12-05 15:08:38 -08:00
util.md 2019-03-06, Version 11.11.0 (Current) 2019-03-06 20:24:50 +01:00
v8.md v8: integrate node-heapdump into core 2019-03-13 15:50:32 +00:00
vm.md doc: fix section order in vm.md 2019-01-14 09:36:41 +01:00
worker_threads.md worker: implement worker.moveMessagePortToContext() 2019-03-15 16:54:19 +01:00
zlib.md doc: add example for setting Vary: Accept-Encoding header in zlib.md 2019-02-28 12:41:11 -08:00