Skip to content

Commit

Permalink
tls: remove sharedCreds in Server constructor
Browse files Browse the repository at this point in the history
This commit removes the var sharedCreds which is just reassigned to
this._sharedCreds in the following line.

PR-URL: #20491
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
danbev authored and MylesBorins committed May 8, 2018
1 parent e362e06 commit e1170db
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit e1170db

Please sign in to comment.