Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions test/parallel/test-https-client-checkServerIdentity.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ if (!common.hasCrypto)

const assert = require('assert');
const https = require('https');
const fs = require('fs');
const path = require('path');
const fixtures = require('../common/fixtures');

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) {
Expand All @@ -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();
Expand All @@ -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;
}
Expand Down