test: replace common.fixturesDir with fixtures.readSync()
Replace common.fixturesDir with fixtures.readSync() in test-tls-getprotocol. PR-URL: https://github.com/nodejs/node/pull/16802 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
94fb298819
commit
e232cd8d22
@ -3,9 +3,12 @@ const common = require('../common');
|
||||
if (!common.hasCrypto)
|
||||
common.skip('missing crypto');
|
||||
|
||||
// This test ensures that `getProtocol` returns the right protocol
|
||||
// from a TLS connection
|
||||
|
||||
const assert = require('assert');
|
||||
const tls = require('tls');
|
||||
const fs = require('fs');
|
||||
const fixtures = require('../common/fixtures');
|
||||
|
||||
const clientConfigs = [
|
||||
{ secureProtocol: 'TLSv1_method', version: 'TLSv1' },
|
||||
@ -14,8 +17,8 @@ const clientConfigs = [
|
||||
];
|
||||
|
||||
const serverConfig = {
|
||||
key: fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`),
|
||||
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`)
|
||||
key: fixtures.readSync('/keys/agent2-key.pem'),
|
||||
cert: fixtures.readSync('/keys/agent2-cert.pem')
|
||||
};
|
||||
|
||||
const server = tls.createServer(serverConfig, common.mustCall(function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user