(message, cb)
| 91 | })); |
| 92 | |
| 93 | function runClient(message, cb) { |
| 94 | const s = tls.connect(common.PORT, { |
| 95 | ciphers: CIPHERS, |
| 96 | checkServerIdentity: () => {}, |
| 97 | pskCallback(hint) { |
| 98 | // 'hint' will be null in TLS1.3. |
| 99 | if (hint === null || hint === IDENTITY) { |
| 100 | return { |
| 101 | identity: IDENTITY, |
| 102 | psk: Buffer.from(KEY, 'hex'), |
| 103 | }; |
| 104 | } |
| 105 | }, |
| 106 | }); |
| 107 | s.on('secureConnect', common.mustCall(() => { |
| 108 | let data = ''; |
| 109 | s.on('data', common.mustCallAtLeast((d) => { |
| 110 | data += d; |
| 111 | })); |
| 112 | s.on('end', common.mustCall(() => { |
| 113 | cb(null, data); |
| 114 | })); |
| 115 | s.end(message); |
| 116 | })); |
| 117 | s.on('error', (e) => { |
| 118 | cb(e); |
| 119 | }); |
| 120 | } |
no test coverage detected
searching dependent graphs…