mirror of https://github.com/nodejs/node.git
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>pull/18803/merge
parent
1fd69872e6
commit
760f86c75b
|
@ -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, ' +
|
||||
|
|
Loading…
Reference in New Issue