Browse Source

test: replace common.fixturesDir with readKey

PR-URL: https://github.com/nodejs/node/pull/15946
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
v9.x-staging
ashleyraymaceli 7 years ago
committed by Gibson Fahnestock
parent
commit
86d803b385
No known key found for this signature in database GPG Key ID: B01FBB92821C587A
  1. 13
      test/parallel/test-http2-https-fallback.js

13
test/parallel/test-http2-https-fallback.js

@ -1,13 +1,12 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
const fixtures = require('../common/fixtures');
if (!common.hasCrypto) if (!common.hasCrypto)
common.skip('missing crypto'); common.skip('missing crypto');
const { strictEqual } = require('assert'); const { strictEqual } = require('assert');
const { join } = require('path');
const { readFileSync } = require('fs');
const { createSecureContext } = require('tls'); const { createSecureContext } = require('tls');
const { createSecureServer, connect } = require('http2'); const { createSecureServer, connect } = require('http2');
const { get } = require('https'); const { get } = require('https');
@ -16,13 +15,9 @@ const { connect: tls } = require('tls');
const countdown = (count, done) => () => --count === 0 && done(); const countdown = (count, done) => () => --count === 0 && done();
function loadKey(keyname) { const key = fixtures.readKey('agent8-key.pem');
return readFileSync(join(common.fixturesDir, 'keys', keyname)); const cert = fixtures.readKey('agent8-cert.pem');
} const ca = fixtures.readKey('fake-startcom-root-cert.pem');
const key = loadKey('agent8-key.pem');
const cert = loadKey('agent8-cert.pem');
const ca = loadKey('fake-startcom-root-cert.pem');
const clientOptions = { secureContext: createSecureContext({ ca }) }; const clientOptions = { secureContext: createSecureContext({ ca }) };

Loading…
Cancel
Save