diff --git a/test/pummel/test-https-ci-reneg-attack.js b/test/pummel/test-https-ci-reneg-attack.js index 50e16192e1b1ca..6faafe5a5ee287 100644 --- a/test/pummel/test-https-ci-reneg-attack.js +++ b/test/pummel/test-https-ci-reneg-attack.js @@ -73,10 +73,14 @@ function test(next) { // Count handshakes, start the attack after the initial handshake is done let handshakes = 0; let renegs = 0; + let waitingToSpam = true; child.stderr.on('data', function(data) { handshakes += ((String(data)).match(/verify return:1/g) || []).length; - if (handshakes === 2) spam(); + if (handshakes === 2 && waitingToSpam) { + waitingToSpam = false; + spam(); + } renegs += ((String(data)).match(/RENEGOTIATING/g) || []).length; }); diff --git a/test/pummel/test-tls-ci-reneg-attack.js b/test/pummel/test-tls-ci-reneg-attack.js index 3509dcfd43f853..00d5dfed482b52 100644 --- a/test/pummel/test-tls-ci-reneg-attack.js +++ b/test/pummel/test-tls-ci-reneg-attack.js @@ -73,11 +73,15 @@ function test(next) { // Count handshakes, start the attack after the initial handshake is done let handshakes = 0; let renegs = 0; + let waitingToSpam = true; child.stderr.on('data', function(data) { if (seenError) return; handshakes += ((String(data)).match(/verify return:1/g) || []).length; - if (handshakes === 2) spam(); + if (handshakes === 2 && waitingToSpam) { + waitingToSpam = false; + spam(); + } renegs += ((String(data)).match(/RENEGOTIATING/g) || []).length; });