From b1909d3a70f9e2ab3d1871848814edbe6130a00e Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 4 Nov 2016 12:37:36 -0700 Subject: [PATCH] tls: add tlsSocket.disableRenegotiation() Allows TLS renegotiation to be disabled per `TLSSocket` instance. Per HTTP/2, TLS renegotiation is forbidden after the initial connection prefix is exchanged. PR-URL: https://github.com/nodejs/node/pull/14239 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Matteo Collina --- doc/api/tls.md | 8 +++ lib/_tls_wrap.js | 10 +++ .../test-tls-disable-renegotiation.js | 67 +++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100755 test/parallel/test-tls-disable-renegotiation.js diff --git a/doc/api/tls.md b/doc/api/tls.md index 80cd2e87263566..2b27189e7604d4 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -552,6 +552,14 @@ added: v0.11.4 Returns `true` if the peer certificate was signed by one of the CAs specified when creating the `tls.TLSSocket` instance, otherwise `false`. +### tlsSocket.disableRenegotiation() + + +Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts +to renegotiate will trigger an `'error'` event on the `TLSSocket`. + ### tlsSocket.encrypted