From c059d3d287aabc19e3809616144901e873e45af8 Mon Sep 17 00:00:00 2001 From: Jeremy Rose Date: Tue, 18 Aug 2020 10:05:43 -0700 Subject: [PATCH] tls: enable renegotiation when using BoringSSL PR-URL: https://github.com/nodejs/node/pull/34832 Reviewed-By: Colin Ihrig Reviewed-By: Shelley Vohr Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: Rich Trott --- src/tls_wrap.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index bb09ee99e07017..95bbc4c6a62ccf 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -128,6 +128,12 @@ void TLSWrap::InitSSL() { // - https://wiki.openssl.org/index.php/TLS1.3#Non-application_data_records SSL_set_mode(ssl_.get(), SSL_MODE_AUTO_RETRY); +#ifdef OPENSSL_IS_BORINGSSL + // OpenSSL allows renegotiation by default, but BoringSSL disables it. + // Configure BoringSSL to match OpenSSL's behavior. + SSL_set_renegotiate_mode(ssl_.get(), ssl_renegotiate_freely); +#endif + SSL_set_app_data(ssl_.get(), this); // Using InfoCallback isn't how we are supposed to check handshake progress: // https://github.com/openssl/openssl/issues/7199#issuecomment-420915993