From ba9801a8d26853e791fd3d16c2dc39c07c790119 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 8 Dec 2017 21:23:29 -0800 Subject: [PATCH] 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 Reviewed-By: Richard Lau Reviewed-By: Jon Moss Reviewed-By: Colin Ihrig --- test/addons/openssl-client-cert-engine/test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/addons/openssl-client-cert-engine/test.js b/test/addons/openssl-client-cert-engine/test.js index d07b9c6a1c2..1c0e4564a5c 100644 --- a/test/addons/openssl-client-cert-engine/test.js +++ b/test/addons/openssl-client-cert-engine/test.js @@ -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