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

Function test

test/parallel/test-tls-multiple-cas-as-string.js:18–38  ·  view source on GitHub ↗
(ca)

Source from the content-addressed store, hash-verified

16const key = fixtures.readKey('agent3-key.pem', 'utf8');
17
18function test(ca) {
19 const server = tls.createServer({ ca, cert, key });
20
21 server.addContext('agent3', { ca, cert, key });
22
23 const host = common.localhostIPv4;
24 server.listen(0, host, common.mustCall(() => {
25 const socket = tls.connect({
26 servername: 'agent3',
27 host,
28 port: server.address().port,
29 ca
30 }, common.mustCall(() => {
31 socket.end();
32 }));
33
34 socket.on('close', () => {
35 server.close();
36 });
37 }));
38}
39
40// `ca1` is not actually necessary for the certificate validation -- maybe
41// the fixtures should be written in a way that requires it?

Calls 6

listenMethod · 0.80
connectMethod · 0.65
addressMethod · 0.65
closeMethod · 0.65
endMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…