test: refactor test-tls-0-dns-altname
* var -> const, let * assert.equal() -> assert.strictEqual() PR-URL: https://github.com/nodejs/node/pull/9948 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
72c773cc33
commit
004a1002b8
@ -1,16 +1,16 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
const common = require('../common');
|
||||||
var assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto) {
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var tls = require('tls');
|
const tls = require('tls');
|
||||||
|
|
||||||
var fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
var server = tls.createServer({
|
const server = tls.createServer({
|
||||||
key: fs.readFileSync(common.fixturesDir + '/keys/0-dns-key.pem'),
|
key: fs.readFileSync(common.fixturesDir + '/keys/0-dns-key.pem'),
|
||||||
cert: fs.readFileSync(common.fixturesDir + '/keys/0-dns-cert.pem')
|
cert: fs.readFileSync(common.fixturesDir + '/keys/0-dns-cert.pem')
|
||||||
}, function(c) {
|
}, function(c) {
|
||||||
@ -19,11 +19,11 @@ var server = tls.createServer({
|
|||||||
server.close();
|
server.close();
|
||||||
});
|
});
|
||||||
}).listen(0, common.mustCall(function() {
|
}).listen(0, common.mustCall(function() {
|
||||||
var c = tls.connect(this.address().port, {
|
const c = tls.connect(this.address().port, {
|
||||||
rejectUnauthorized: false
|
rejectUnauthorized: false
|
||||||
}, common.mustCall(function() {
|
}, common.mustCall(function() {
|
||||||
var cert = c.getPeerCertificate();
|
const cert = c.getPeerCertificate();
|
||||||
assert.equal(cert.subjectaltname,
|
assert.strictEqual(cert.subjectaltname,
|
||||||
'DNS:google.com\0.evil.com, ' +
|
'DNS:google.com\0.evil.com, ' +
|
||||||
'DNS:just-another.com, ' +
|
'DNS:just-another.com, ' +
|
||||||
'IP Address:8.8.8.8, ' +
|
'IP Address:8.8.8.8, ' +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user