Skip to content

Commit ff43209

Browse files
juggernaut451MylesBorins
authored andcommitted
test: refactor parallel/test-tls-0-dns-altname
PR-URL: #18803 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 0eead8c commit ff43209

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/parallel/test-tls-0-dns-altname.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ const fixtures = require('../common/fixtures');
3333
const server = tls.createServer({
3434
key: fixtures.readSync(['0-dns', '0-dns-key.pem']),
3535
cert: fixtures.readSync(['0-dns', '0-dns-cert.pem'])
36-
}, function(c) {
37-
c.once('data', function() {
36+
}, common.mustCall((c) => {
37+
c.once('data', common.mustCall(() => {
3838
c.destroy();
3939
server.close();
40-
});
41-
}).listen(0, common.mustCall(function() {
42-
const c = tls.connect(this.address().port, {
40+
}));
41+
})).listen(0, common.mustCall(() => {
42+
const c = tls.connect(server.address().port, {
4343
rejectUnauthorized: false
44-
}, common.mustCall(function() {
44+
}, common.mustCall(() => {
4545
const cert = c.getPeerCertificate();
4646
assert.strictEqual(cert.subjectaltname,
4747
'DNS:good.example.org\0.evil.example.com, ' +

0 commit comments

Comments
 (0)