Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6b9d477

Browse filesBrowse files
danbevBridgeAR
authored andcommitted
tls: rename validateKeyCert in _tls_common.js
This commit renames validateKeyCert to validateKeyCertArg to avoid confusing this with something that would validate the actual key or certificate. PR-URL: #28116 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 303a9a3 commit 6b9d477
Copy full SHA for 6b9d477

File tree

Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Collapse file

‎lib/_tls_common.js‎

Copy file name to clipboardExpand all lines: lib/_tls_common.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function SecureContext(secureProtocol, secureOptions, minVersion, maxVersion) {
7575
if (secureOptions) this.context.setOptions(secureOptions);
7676
}
7777

78-
function validateKeyCert(name, value) {
78+
function validateKeyOrCertOption(name, value) {
7979
if (typeof value !== 'string' && !isArrayBufferView(value)) {
8080
throw new ERR_INVALID_ARG_TYPE(
8181
`options.${name}`,
@@ -107,11 +107,11 @@ exports.createSecureContext = function createSecureContext(options) {
107107
if (Array.isArray(ca)) {
108108
for (i = 0; i < ca.length; ++i) {
109109
val = ca[i];
110-
validateKeyCert('ca', val);
110+
validateKeyOrCertOption('ca', val);
111111
c.context.addCACert(val);
112112
}
113113
} else {
114-
validateKeyCert('ca', ca);
114+
validateKeyOrCertOption('ca', ca);
115115
c.context.addCACert(ca);
116116
}
117117
} else {
@@ -123,11 +123,11 @@ exports.createSecureContext = function createSecureContext(options) {
123123
if (Array.isArray(cert)) {
124124
for (i = 0; i < cert.length; ++i) {
125125
val = cert[i];
126-
validateKeyCert('cert', val);
126+
validateKeyOrCertOption('cert', val);
127127
c.context.setCert(val);
128128
}
129129
} else {
130-
validateKeyCert('cert', cert);
130+
validateKeyOrCertOption('cert', cert);
131131
c.context.setCert(cert);
132132
}
133133
}
@@ -144,11 +144,11 @@ exports.createSecureContext = function createSecureContext(options) {
144144
val = key[i];
145145
// eslint-disable-next-line eqeqeq
146146
const pem = (val != undefined && val.pem !== undefined ? val.pem : val);
147-
validateKeyCert('key', pem);
147+
validateKeyOrCertOption('key', pem);
148148
c.context.setKey(pem, val.passphrase || passphrase);
149149
}
150150
} else {
151-
validateKeyCert('key', key);
151+
validateKeyOrCertOption('key', key);
152152
c.context.setKey(key, passphrase);
153153
}
154154
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.