From 392e999eeaad377020c8e8b8fb930778fe84d115 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. --- 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 2e6b2e8da559db..604ff77a0fb022 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -875,7 +875,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, @@ -891,7 +891,6 @@ function Server(options, listener) { crl: this.crl, sessionIdContext: this.sessionIdContext }); - this._sharedCreds = sharedCreds; this[kHandshakeTimeout] = options.handshakeTimeout || (120 * 1000); this[kSNICallback] = options.SNICallback; @@ -902,11 +901,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