From 0bbf4552113a8ee9f426abbe963590acf6c90206 Mon Sep 17 00:00:00 2001 From: Emily Marigold Klassen Date: Fri, 6 Oct 2017 10:09:09 -0700 Subject: [PATCH] test: use common.fixtures in checkServerIdentity PR-URL: https://github.com/nodejs/node/pull/15951 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung --- .../parallel/test-https-client-checkServerIdentity.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-https-client-checkServerIdentity.js b/test/parallel/test-https-client-checkServerIdentity.js index 9842fc1f35..87c9ec8229 100644 --- a/test/parallel/test-https-client-checkServerIdentity.js +++ b/test/parallel/test-https-client-checkServerIdentity.js @@ -25,13 +25,12 @@ if (!common.hasCrypto) common.skip('missing crypto'); const assert = require('assert'); +const fixtures = require('../common/fixtures'); const https = require('https'); -const fs = require('fs'); -const path = require('path'); const options = { - key: fs.readFileSync(path.join(common.fixturesDir, 'keys/agent3-key.pem')), - cert: fs.readFileSync(path.join(common.fixturesDir, 'keys/agent3-cert.pem')) + key: fixtures.readKey('agent3-key.pem'), + cert: fixtures.readKey('agent3-cert.pem') }; const server = https.createServer(options, common.mustCall(function(req, res) { @@ -46,7 +45,7 @@ function authorized() { const req = https.request({ port: server.address().port, rejectUnauthorized: true, - ca: [fs.readFileSync(path.join(common.fixturesDir, 'keys/ca2-cert.pem'))] + ca: [fixtures.readKey('ca2-cert.pem')] }, common.mustNotCall()); req.on('error', function(err) { override(); @@ -58,7 +57,7 @@ function override() { const options = { port: server.address().port, rejectUnauthorized: true, - ca: [fs.readFileSync(path.join(common.fixturesDir, 'keys/ca2-cert.pem'))], + ca: [fixtures.readKey('ca2-cert.pem')], checkServerIdentity: function(host, cert) { return false; }