Skip to content

Commit

Permalink
test: replace common.fixturesDir with readKey
Browse files Browse the repository at this point in the history
PR-URL: #15946
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
AshleyRayMaceli authored and gibfahn committed Oct 8, 2017
1 parent 2b5b423 commit 86d803b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/parallel/test-http2-https-fallback.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
'use strict';

const common = require('../common');
const fixtures = require('../common/fixtures');

if (!common.hasCrypto)
common.skip('missing crypto');

const { strictEqual } = require('assert');
const { join } = require('path');
const { readFileSync } = require('fs');
const { createSecureContext } = require('tls');
const { createSecureServer, connect } = require('http2');
const { get } = require('https');
Expand All @@ -16,13 +15,9 @@ const { connect: tls } = require('tls');

const countdown = (count, done) => () => --count === 0 && done();

function loadKey(keyname) {
return readFileSync(join(common.fixturesDir, 'keys', keyname));
}

const key = loadKey('agent8-key.pem');
const cert = loadKey('agent8-cert.pem');
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');

const clientOptions = { secureContext: createSecureContext({ ca }) };

Expand Down

0 comments on commit 86d803b

Please sign in to comment.