@@ -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 validateKeyCertArg ( 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+ validateKeyCertArg ( 'ca' , val ) ;
111111 c . context . addCACert ( val ) ;
112112 }
113113 } else {
114- validateKeyCert ( 'ca' , ca ) ;
114+ validateKeyCertArg ( '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+ validateKeyCertArg ( 'cert' , val ) ;
127127 c . context . setCert ( val ) ;
128128 }
129129 } else {
130- validateKeyCert ( 'cert' , cert ) ;
130+ validateKeyCertArg ( '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+ validateKeyCertArg ( 'key' , pem ) ;
148148 c . context . setKey ( pem , val . passphrase || passphrase ) ;
149149 }
150150 } else {
151- validateKeyCert ( 'key' , key ) ;
151+ validateKeyCertArg ( 'key' , key ) ;
152152 c . context . setKey ( key , passphrase ) ;
153153 }
154154 }
0 commit comments