| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 303a9a3 commit 6b9d477
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,7 +75,7 @@ function SecureContext(secureProtocol, secureOptions, minVersion, maxVersion) { | |||
| 75 | 75 | if (secureOptions) this.context.setOptions(secureOptions); | |
| 76 | 76 | } | |
| 77 | 77 | ||
| 78 | - function validateKeyCert(name, value) { | ||
| 78 | + function validateKeyOrCertOption(name, value) { | ||
| 79 | 79 | if (typeof value !== 'string' && !isArrayBufferView(value)) { | |
| 80 | 80 | throw new ERR_INVALID_ARG_TYPE( | |
| 81 | 81 | `options.${name}`, | |
@@ -107,11 +107,11 @@ exports.createSecureContext = function createSecureContext(options) { | |||
| 107 | 107 | if (Array.isArray(ca)) { | |
| 108 | 108 | for (i = 0; i < ca.length; ++i) { | |
| 109 | 109 | val = ca[i]; | |
| 110 | - validateKeyCert('ca', val); | ||
| 110 | + validateKeyOrCertOption('ca', val); | ||
| 111 | 111 | c.context.addCACert(val); | |
| 112 | 112 | } | |
| 113 | 113 | } else { | |
| 114 | - validateKeyCert('ca', ca); | ||
| 114 | + validateKeyOrCertOption('ca', ca); | ||
| 115 | 115 | c.context.addCACert(ca); | |
| 116 | 116 | } | |
| 117 | 117 | } else { | |
@@ -123,11 +123,11 @@ exports.createSecureContext = function createSecureContext(options) { | |||
| 123 | 123 | if (Array.isArray(cert)) { | |
| 124 | 124 | for (i = 0; i < cert.length; ++i) { | |
| 125 | 125 | val = cert[i]; | |
| 126 | - validateKeyCert('cert', val); | ||
| 126 | + validateKeyOrCertOption('cert', val); | ||
| 127 | 127 | c.context.setCert(val); | |
| 128 | 128 | } | |
| 129 | 129 | } else { | |
| 130 | - validateKeyCert('cert', cert); | ||
| 130 | + validateKeyOrCertOption('cert', cert); | ||
| 131 | 131 | c.context.setCert(cert); | |
| 132 | 132 | } | |
| 133 | 133 | } | |
@@ -144,11 +144,11 @@ exports.createSecureContext = function createSecureContext(options) { | |||
| 144 | 144 | val = key[i]; | |
| 145 | 145 | // eslint-disable-next-line eqeqeq | |
| 146 | 146 | const pem = (val != undefined && val.pem !== undefined ? val.pem : val); | |
| 147 | - validateKeyCert('key', pem); | ||
| 147 | + validateKeyOrCertOption('key', pem); | ||
| 148 | 148 | c.context.setKey(pem, val.passphrase || passphrase); | |
| 149 | 149 | } | |
| 150 | 150 | } else { | |
| 151 | - validateKeyCert('key', key); | ||
| 151 | + validateKeyOrCertOption('key', key); | ||
| 152 | 152 | c.context.setKey(key, passphrase); | |
| 153 | 153 | } | |
| 154 | 154 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments