Skip to content

Commit

Permalink
test: refactor parallel/test-tls-0-dns-altname
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
juggernaut451 authored and MylesBorins committed Feb 21, 2018
1 parent f960ad4 commit dba5e35
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-tls-0-dns-altname.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, ' +
Expand Down

0 comments on commit dba5e35

Please sign in to comment.