We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67cef9b commit 73231d9Copy full SHA for 73231d9
1 file changed
test/parallel/test-http2-https-fallback.js
@@ -2,13 +2,12 @@
2
'use strict';
3
4
const common = require('../common');
5
+const fixtures = require('../common/fixtures');
6
7
if (!common.hasCrypto)
8
common.skip('missing crypto');
9
10
const { strictEqual } = require('assert');
-const { join } = require('path');
11
-const { readFileSync } = require('fs');
12
const { createSecureContext } = require('tls');
13
const { createSecureServer, connect } = require('http2');
14
const { get } = require('https');
@@ -17,13 +16,9 @@ const { connect: tls } = require('tls');
17
16
18
const countdown = (count, done) => () => --count === 0 && done();
19
20
-function loadKey(keyname) {
21
- return readFileSync(join(common.fixturesDir, 'keys', keyname));
22
-}
23
-
24
-const key = loadKey('agent8-key.pem');
25
-const cert = loadKey('agent8-cert.pem');
26
-const ca = loadKey('fake-startcom-root-cert.pem');
+const key = fixtures.readKey('agent8-key.pem');
+const cert = fixtures.readKey('agent8-cert.pem');
+const ca = fixtures.readKey('fake-startcom-root-cert.pem');
27
28
const clientOptions = { secureContext: createSecureContext({ ca }) };
29
0 commit comments