diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2018-11-07 16:36:19 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-11-09 18:28:07 -0800 |
commit | 3b4159c8ed85b6b531b7df09378d67168574d731 (patch) | |
tree | 13470a5ca0425e1c8b0b4b6888668f20a92b496e /lib/_tls_common.js | |
parent | 624a242b05397fdacc1e79007de223cd0331f6e8 (diff) | |
download | android-node-v8-3b4159c8ed85b6b531b7df09378d67168574d731.tar.gz android-node-v8-3b4159c8ed85b6b531b7df09378d67168574d731.tar.bz2 android-node-v8-3b4159c8ed85b6b531b7df09378d67168574d731.zip |
tls: remove unused arg to createSecureContext()
The context arg is unused by node or its test suites and undocumented.
Remove it.
PR-URL: https://github.com/nodejs/node/pull/24241
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib/_tls_common.js')
-rw-r--r-- | lib/_tls_common.js | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/_tls_common.js b/lib/_tls_common.js index 2a88045067..7153334a14 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -35,22 +35,13 @@ const { SSL_OP_CIPHER_SERVER_PREFERENCE } = internalBinding('constants').crypto; let toBuf = null; const { SecureContext: NativeSecureContext } = internalBinding('crypto'); -function SecureContext(secureProtocol, secureOptions, context) { +function SecureContext(secureProtocol, secureOptions) { if (!(this instanceof SecureContext)) { - return new SecureContext(secureProtocol, secureOptions, context); + return new SecureContext(secureProtocol, secureOptions); } - if (context) { - this.context = context; - } else { - this.context = new NativeSecureContext(); - - if (secureProtocol) { - this.context.init(secureProtocol); - } else { - this.context.init(); - } - } + this.context = new NativeSecureContext(); + this.context.init(secureProtocol); if (secureOptions) this.context.setOptions(secureOptions); } @@ -68,19 +59,17 @@ function validateKeyCert(name, value) { exports.SecureContext = SecureContext; -exports.createSecureContext = function createSecureContext(options, context) { +exports.createSecureContext = function createSecureContext(options) { if (!options) options = {}; var secureOptions = options.secureOptions; if (options.honorCipherOrder) secureOptions |= SSL_OP_CIPHER_SERVER_PREFERENCE; - const c = new SecureContext(options.secureProtocol, secureOptions, context); + const c = new SecureContext(options.secureProtocol, secureOptions); var i; var val; - if (context) return c; - // NOTE: It's important to add CA before the cert to be able to load // cert's issuer in C++ code. const { ca } = options; |