(ciphers, name)
| 94 | } |
| 95 | |
| 96 | function processCiphers(ciphers, name) { |
| 97 | ciphers = StringPrototypeSplit(ciphers || getDefaultCiphers(), ':'); |
| 98 | |
| 99 | const cipherList = |
| 100 | ArrayPrototypeJoin( |
| 101 | ArrayPrototypeFilter( |
| 102 | ciphers, |
| 103 | (cipher) => { |
| 104 | if (cipher.length === 0) return false; |
| 105 | if (StringPrototypeStartsWith(cipher, 'TLS_')) return false; |
| 106 | if (StringPrototypeStartsWith(cipher, '!TLS_')) return false; |
| 107 | return true; |
| 108 | }), ':'); |
| 109 | |
| 110 | const cipherSuites = |
| 111 | ArrayPrototypeJoin( |
| 112 | ArrayPrototypeFilter( |
| 113 | ciphers, |
| 114 | (cipher) => { |
| 115 | if (cipher.length === 0) return false; |
| 116 | if (StringPrototypeStartsWith(cipher, 'TLS_')) return true; |
| 117 | if (StringPrototypeStartsWith(cipher, '!TLS_')) return true; |
| 118 | return false; |
| 119 | }), ':'); |
| 120 | |
| 121 | // Specifying empty cipher suites for both TLS1.2 and TLS1.3 is invalid, its |
| 122 | // not possible to handshake with no suites. |
| 123 | if (cipherSuites === '' && cipherList === '') |
| 124 | throw new ERR_INVALID_ARG_VALUE(name, ciphers); |
| 125 | |
| 126 | return { cipherList, cipherSuites }; |
| 127 | } |
| 128 | |
| 129 | function configSecureContext(context, options = kEmptyObject, name = 'options') { |
| 130 | validateObject(options, name); |
no test coverage detected
searching dependent graphs…