forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquic.js
More file actions
38 lines (32 loc) · 869 Bytes
/
quic.js
File metadata and controls
38 lines (32 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
// Common bits for all QUIC-related tests
const { debuglog } = require('util');
const { readKeys } = require('./fixtures');
const { createWriteStream } = require('fs');
const kHttp3Alpn = 'h3-29';
const [ key, cert, ca ] =
readKeys(
'binary',
'agent1-key.pem',
'agent1-cert.pem',
'ca1-cert.pem');
const debug = debuglog('test');
const kServerPort = process.env.NODE_DEBUG_KEYLOG ? 5678 : 0;
const kClientPort = process.env.NODE_DEBUG_KEYLOG ? 5679 : 0;
function setupKeylog(session) {
if (process.env.NODE_DEBUG_KEYLOG) {
const kl = createWriteStream(process.env.NODE_DEBUG_KEYLOG);
session.on('keylog', kl.write.bind(kl));
}
}
module.exports = {
key,
cert,
ca,
debug,
kServerPort,
kClientPort,
setupKeylog,
kHttp3Alpn,
};