diff options
author | juggernaut451 <singhjug1994@gmail.com> | 2018-02-16 01:45:50 +0530 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-08-16 01:59:11 -0400 |
commit | 488e1bbe8120c318219ef66c35af1273ad48ef5b (patch) | |
tree | df927c187d81fc0aacbfcf577c71dd8e2094771b /test | |
parent | 4a267f0e3c08bf8de51495039524ba30c89610e9 (diff) | |
download | node-new-488e1bbe8120c318219ef66c35af1273ad48ef5b.tar.gz |
test: refactor parallel/test-tls-0-dns-altname
PR-URL: https://github.com/nodejs/node/pull/18803
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-tls-0-dns-altname.js | 12 |
1 files 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 5952d6b02c..4bc87e44cb 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, ' + |