From 161182ec05191b0e1f6e58ced1c8b567393aceda Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 3 May 2018 08:28:45 +0200 Subject: [PATCH] tls: remove sharedCreds in Server constructor This commit removes the var sharedCreds which is just reassigned to this._sharedCreds in the following line. PR-URL: https://github.com/nodejs/node/pull/20491 Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater --- lib/_tls_wrap.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 65c684abfe89a3..d85d85752b631b 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -871,7 +871,7 @@ function Server(options, listener) { // Handle option defaults: this.setOptions(options); - var sharedCreds = tls.createSecureContext({ + this._sharedCreds = tls.createSecureContext({ pfx: this.pfx, key: this.key, passphrase: this.passphrase, @@ -887,7 +887,6 @@ function Server(options, listener) { crl: this.crl, sessionIdContext: this.sessionIdContext }); - this._sharedCreds = sharedCreds; this[kHandshakeTimeout] = options.handshakeTimeout || (120 * 1000); this[kSNICallback] = options.SNICallback; @@ -898,11 +897,11 @@ function Server(options, listener) { } if (this.sessionTimeout) { - sharedCreds.context.setSessionTimeout(this.sessionTimeout); + this._sharedCreds.context.setSessionTimeout(this.sessionTimeout); } if (this.ticketKeys) { - sharedCreds.context.setTicketKeys(this.ticketKeys); + this._sharedCreds.context.setTicketKeys(this.ticketKeys); } // constructor call