MCPcopy Index your code
hub / github.com/nodejs/node / processCiphers

Function processCiphers

lib/internal/tls/secure-context.js:96–127  ·  view source on GitHub ↗
(ciphers, name)

Source from the content-addressed store, hash-verified

94}
95
96function 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
129function configSecureContext(context, options = kEmptyObject, name = 'options') {
130 validateObject(options, name);

Callers 1

configSecureContextFunction · 0.85

Calls 1

getDefaultCiphersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…