tls: remove unused arg to createSecureContext() · nodejs/node@3b4159c (original) (raw)
`@@ -35,22 +35,13 @@ const { SSL_OP_CIPHER_SERVER_PREFERENCE } = internalBinding('constants').crypto;
`
35
35
`let toBuf = null;
`
36
36
``
37
37
`const { SecureContext: NativeSecureContext } = internalBinding('crypto');
`
38
``
`-
function SecureContext(secureProtocol, secureOptions, context) {
`
``
38
`+
function SecureContext(secureProtocol, secureOptions) {
`
39
39
`if (!(this instanceof SecureContext)) {
`
40
``
`-
return new SecureContext(secureProtocol, secureOptions, context);
`
``
40
`+
return new SecureContext(secureProtocol, secureOptions);
`
41
41
`}
`
42
42
``
43
``
`-
if (context) {
`
44
``
`-
this.context = context;
`
45
``
`-
} else {
`
46
``
`-
this.context = new NativeSecureContext();
`
47
``
-
48
``
`-
if (secureProtocol) {
`
49
``
`-
this.context.init(secureProtocol);
`
50
``
`-
} else {
`
51
``
`-
this.context.init();
`
52
``
`-
}
`
53
``
`-
}
`
``
43
`+
this.context = new NativeSecureContext();
`
``
44
`+
this.context.init(secureProtocol);
`
54
45
``
55
46
`if (secureOptions) this.context.setOptions(secureOptions);
`
56
47
`}
`
`@@ -68,19 +59,17 @@ function validateKeyCert(name, value) {
`
68
59
`exports.SecureContext = SecureContext;
`
69
60
``
70
61
``
71
``
`-
exports.createSecureContext = function createSecureContext(options, context) {
`
``
62
`+
exports.createSecureContext = function createSecureContext(options) {
`
72
63
`if (!options) options = {};
`
73
64
``
74
65
`var secureOptions = options.secureOptions;
`
75
66
`if (options.honorCipherOrder)
`
76
67
`secureOptions |= SSL_OP_CIPHER_SERVER_PREFERENCE;
`
77
68
``
78
``
`-
const c = new SecureContext(options.secureProtocol, secureOptions, context);
`
``
69
`+
const c = new SecureContext(options.secureProtocol, secureOptions);
`
79
70
`var i;
`
80
71
`var val;
`
81
72
``
82
``
`-
if (context) return c;
`
83
``
-
84
73
`// NOTE: It's important to add CA before the cert to be able to load
`
85
74
`// cert's issuer in C++ code.
`
86
75
`const { ca } = options;
`