Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2019-10-22 00:27:50 +0300
committerRich Trott <rtrott@gmail.com>2019-11-20 09:23:23 +0300
commitb0cf62b3a05cf1b207441de2ce3d33a3a57acd5f (patch)
tree25a39101af1639840340a922d2f68ebbd8b83766 /doc/api/https.md
parent9d09969f4c29b7f2bacc9cb44e210c4e269945a4 (diff)
https: add client support for TLS keylog events
The keylog event is implemented on TLS sockets, but client HTTPS uses TLS sockets managed by an agent, so accessing the underlying socket before the TLS handshake completed was not possible. Note that server HTTPS already supports the keylog event because it inherits from the TLS server. PR-URL: https://github.com/nodejs/node/pull/30053 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/https.md')
-rw-r--r--doc/api/https.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/api/https.md b/doc/api/https.md
index 0d8f859e9c7..6f0d481ffb8 100644
--- a/doc/api/https.md
+++ b/doc/api/https.md
@@ -45,6 +45,31 @@ changes:
See [`Session Resumption`][] for information about TLS session reuse.
+#### Event: 'keylog'
+<!-- YAML
+added: REPLACEME
+-->
+
+* `line` {Buffer} Line of ASCII text, in NSS `SSLKEYLOGFILE` format.
+* `tlsSocket` {tls.TLSSocket} The `tls.TLSSocket` instance on which it was
+ generated.
+
+The `keylog` event is emitted when key material is generated or received by a
+connection managed by this agent (typically before handshake has completed, but
+not necessarily). This keying material can be stored for debugging, as it
+allows captured TLS traffic to be decrypted. It may be emitted multiple times
+for each socket.
+
+A typical use case is to append received lines to a common text file, which is
+later used by software (such as Wireshark) to decrypt the traffic:
+
+```js
+// ...
+https.globalAgent.on('keylog', (line, tlsSocket) => {
+ fs.appendFileSync('/tmp/ssl-keys.log', line, { mode: 0o600 });
+});
+```
+
## Class: https.Server
<!-- YAML
added: v0.3.4