diff --git a/test/pummel/test-https-ci-reneg-attack.js b/test/pummel/test-https-ci-reneg-attack.js index fad8cd992dd35d..f34010b1e54253 100644 --- a/test/pummel/test-https-ci-reneg-attack.js +++ b/test/pummel/test-https-ci-reneg-attack.js @@ -65,8 +65,9 @@ function test(next) { res.end('ok'); }); - server.listen(common.PORT, function() { - const args = (`s_client -connect 127.0.0.1:${common.PORT}`).split(' '); + server.listen(0, function() { + const cmd = `s_client -connect 127.0.0.1:${server.address().port}`; + const args = cmd.split(' '); const child = spawn(common.opensslCli, args); child.stdout.resume();