0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 23:43:09 +01:00

test: remove unnecessary use of common.PORT in addons test

Using port 0 to request an open port from the operating system is
sufficient in openssl-client-cert-engine/test.js.

PR-URL: https://github.com/nodejs/node/pull/17563
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Rich Trott 2017-12-08 21:23:29 -08:00
parent 800ce94e5c
commit ba9801a8d2

View File

@ -21,8 +21,6 @@ const agentKey = fs.readFileSync(fixture.path('/keys/agent1-key.pem'));
const agentCert = fs.readFileSync(fixture.path('/keys/agent1-cert.pem'));
const agentCa = fs.readFileSync(fixture.path('/keys/ca1-cert.pem'));
const port = common.PORT;
const serverOptions = {
key: agentKey,
cert: agentCert,
@ -34,11 +32,11 @@ const serverOptions = {
const server = https.createServer(serverOptions, (req, res) => {
res.writeHead(200);
res.end('hello world');
}).listen(port, common.localhostIPv4, () => {
}).listen(0, common.localhostIPv4, () => {
const clientOptions = {
method: 'GET',
host: common.localhostIPv4,
port: port,
port: server.address().port,
path: '/test',
clientCertEngine: engine, // engine will provide key+cert
rejectUnauthorized: false, // prevent failing on self-signed certificates