diff options
author | Rich Trott <rtrott@gmail.com> | 2017-12-08 21:23:29 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-12-11 19:52:23 -0800 |
commit | ba9801a8d26853e791fd3d16c2dc39c07c790119 (patch) | |
tree | 9ad1c7b560ac4038dbd5f0bb23b2d059ab0660fa /test/addons/openssl-client-cert-engine | |
parent | 800ce94e5cdaa8dba7cf69b4c560a66a51ae0ec8 (diff) | |
download | android-node-v8-ba9801a8d26853e791fd3d16c2dc39c07c790119.tar.gz android-node-v8-ba9801a8d26853e791fd3d16c2dc39c07c790119.tar.bz2 android-node-v8-ba9801a8d26853e791fd3d16c2dc39c07c790119.zip |
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>
Diffstat (limited to 'test/addons/openssl-client-cert-engine')
-rw-r--r-- | test/addons/openssl-client-cert-engine/test.js | 6 |
1 files 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 d07b9c6a1c..1c0e4564a5 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 |