summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2019-02-07 13:27:14 -0800
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-02-13 05:14:32 +0100
commit666beb0421a10c6f062bff88828b9ccad7b3fceb (patch)
treea52908b216c9d7cfca2432085d2e5e16db12d580 /lib
parent006e78cecbdd70f40a14a1485cd6a24b6fab2ee1 (diff)
downloadandroid-node-v8-666beb0421a10c6f062bff88828b9ccad7b3fceb.tar.gz
android-node-v8-666beb0421a10c6f062bff88828b9ccad7b3fceb.tar.bz2
android-node-v8-666beb0421a10c6f062bff88828b9ccad7b3fceb.zip
tls: renegotiate should take care of its own state
In the initial version of this test there were two zero-length writes to force tls state to cycle. The second is not necessary, at least not now, but the first was. The renegotiate() API should ensure that packet exchange takes place, not its users, so move the zero-length write into tls. See: https://github.com/nodejs/node/pull/14239 See: https://github.com/nodejs/node/commit/b1909d3a70f9 PR-URL: https://github.com/nodejs/node/pull/25997 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/_tls_wrap.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index 182dab7584..eaf937640e 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -621,6 +621,9 @@ TLSSocket.prototype.renegotiate = function(options, callback) {
this._requestCert = requestCert;
this._rejectUnauthorized = rejectUnauthorized;
}
+ // Ensure that we'll cycle through internal openssl's state
+ this.write('');
+
if (!this._handle.renegotiate()) {
if (callback) {
process.nextTick(callback, new ERR_TLS_RENEGOTIATE());