Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a9172f

Browse filesBrowse 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 <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>
1 parent 03d2514 commit 5a9172f
Copy full SHA for 5a9172f

File tree

Expand file treeCollapse file tree

1 file changed

+2
-4
lines changed
Open diff view settings
Filter options
  • test/addons/openssl-client-cert-engine
Expand file treeCollapse file tree

1 file changed

+2
-4
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/addons/openssl-client-cert-engine/test.js
+2-4Lines changed: 2 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.