Skip to content

Commit 5a9172f

Browse files
TrottMylesBorins
authored andcommitted
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: #17563 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 03d2514 commit 5a9172f

File tree

1 file changed

+2
-4
lines changed
  • test/addons/openssl-client-cert-engine

1 file changed

+2
-4
lines changed

test/addons/openssl-client-cert-engine/test.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ const agentKey = fs.readFileSync(fixture.path('/keys/agent1-key.pem'));
2121
const agentCert = fs.readFileSync(fixture.path('/keys/agent1-cert.pem'));
2222
const agentCa = fs.readFileSync(fixture.path('/keys/ca1-cert.pem'));
2323

24-
const port = common.PORT;
25-
2624
const serverOptions = {
2725
key: agentKey,
2826
cert: agentCert,
@@ -34,11 +32,11 @@ const serverOptions = {
3432
const server = https.createServer(serverOptions, (req, res) => {
3533
res.writeHead(200);
3634
res.end('hello world');
37-
}).listen(port, common.localhostIPv4, () => {
35+
}).listen(0, common.localhostIPv4, () => {
3836
const clientOptions = {
3937
method: 'GET',
4038
host: common.localhostIPv4,
41-
port: port,
39+
port: server.address().port,
4240
path: '/test',
4341
clientCertEngine: engine, // engine will provide key+cert
4442
rejectUnauthorized: false, // prevent failing on self-signed certificates

0 commit comments

Comments
 (0)