diff --git a/test/pummel/test-https-ci-reneg-attack.js b/test/parallel/test-https-client-renegotiation-limit.js similarity index 91% rename from test/pummel/test-https-ci-reneg-attack.js rename to test/parallel/test-https-client-renegotiation-limit.js index 592dd682732..1fccc7bb5d1 100644 --- a/test/pummel/test-https-ci-reneg-attack.js +++ b/test/parallel/test-https-client-renegotiation-limit.js @@ -48,12 +48,12 @@ const LIMITS = [0, 1, 2, 3, 5, 10, 16]; function test(next) { const options = { cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + key: fixtures.readSync('test_key.pem'), }; - const server = https.createServer(options, function(req, res) { + const server = https.createServer(options, (req, res) => { const conn = req.connection; - conn.on('error', function(err) { + conn.on('error', (err) => { console.error(`Caught exception: ${err}`); assert(/TLS session renegotiation attack/.test(err)); conn.destroy(); @@ -61,7 +61,7 @@ function test(next) { res.end('ok'); }); - server.listen(0, function() { + server.listen(0, () => { const agent = https.Agent({ keepAlive: true, }); @@ -71,7 +71,7 @@ function test(next) { const options = { rejectUnauthorized: false, - agent + agent, }; const { port } = server.address(); @@ -79,14 +79,14 @@ function test(next) { https.get(`https://localhost:${port}/`, options, (res) => { client = res.socket; - client.on('close', function(hadErr) { + client.on('close', (hadErr) => { assert.strictEqual(hadErr, false); assert.strictEqual(renegs, tls.CLIENT_RENEG_LIMIT + 1); server.close(); process.nextTick(next); }); - client.on('error', function(err) { + client.on('error', (err) => { console.log('CLIENT ERR', err); throw err; }); diff --git a/test/pummel/test-tls-ci-reneg-attack.js b/test/parallel/test-tls-client-renegotiation-limit.js similarity index 88% rename from test/pummel/test-tls-ci-reneg-attack.js rename to test/parallel/test-tls-client-renegotiation-limit.js index 558efdbdece..daae92eeb46 100644 --- a/test/pummel/test-tls-ci-reneg-attack.js +++ b/test/parallel/test-tls-client-renegotiation-limit.js @@ -47,11 +47,11 @@ const LIMITS = [0, 1, 2, 3, 5, 10, 16]; function test(next) { const options = { cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + key: fixtures.readSync('test_key.pem'), }; - const server = tls.createServer(options, function(conn) { - conn.on('error', function(err) { + const server = tls.createServer(options, (conn) => { + conn.on('error', (err) => { console.error(`Caught exception: ${err}`); assert(/TLS session renegotiation attack/.test(err)); conn.destroy(); @@ -59,28 +59,28 @@ function test(next) { conn.pipe(conn); }); - server.listen(0, function() { + server.listen(0, () => { const options = { host: server.address().host, port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }; const client = tls.connect(options, spam); let renegs = 0; - client.on('close', function() { + client.on('close', () => { assert.strictEqual(renegs, tls.CLIENT_RENEG_LIMIT + 1); server.close(); process.nextTick(next); }); - client.on('error', function(err) { + client.on('error', (err) => { console.log('CLIENT ERR', err); throw err; }); - client.on('close', function(hadErr) { + client.on('close', (hadErr) => { assert.strictEqual(hadErr, false); });