From d05a652801610d34f905db21f5a55e593c21d3fd Mon Sep 17 00:00:00 2001 From: juggernaut451 Date: Fri, 16 Feb 2018 01:45:50 +0530 Subject: [PATCH] test: refactor parallel/test-tls-0-dns-altname PR-URL: https://github.com/nodejs/node/pull/18803 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- test/parallel/test-tls-0-dns-altname.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-tls-0-dns-altname.js b/test/parallel/test-tls-0-dns-altname.js index 5952d6b02cb239..4bc87e44cb60c1 100644 --- a/test/parallel/test-tls-0-dns-altname.js +++ b/test/parallel/test-tls-0-dns-altname.js @@ -33,15 +33,15 @@ const fixtures = require('../common/fixtures'); const server = tls.createServer({ key: fixtures.readSync(['0-dns', '0-dns-key.pem']), cert: fixtures.readSync(['0-dns', '0-dns-cert.pem']) -}, function(c) { - c.once('data', function() { +}, common.mustCall((c) => { + c.once('data', common.mustCall(() => { c.destroy(); server.close(); - }); -}).listen(0, common.mustCall(function() { - const c = tls.connect(this.address().port, { + })); +})).listen(0, common.mustCall(() => { + const c = tls.connect(server.address().port, { rejectUnauthorized: false - }, common.mustCall(function() { + }, common.mustCall(() => { const cert = c.getPeerCertificate(); assert.strictEqual(cert.subjectaltname, 'DNS:good.example.org\0.evil.example.com, ' +