Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: const, let and strictEqual in test-tls-0 #9948

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions test/parallel/test-tls-0-dns-altname.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
'use strict';
var common = require('../common');
var assert = require('assert');
const common = require('../common');
const assert = require('assert');

if (!common.hasCrypto) {
common.skip('missing crypto');
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'),
cert: fs.readFileSync(common.fixturesDir + '/keys/0-dns-cert.pem')
}, function(c) {
Expand All @@ -19,16 +19,16 @@ var server = tls.createServer({
server.close();
});
}).listen(0, common.mustCall(function() {
var c = tls.connect(this.address().port, {
const c = tls.connect(this.address().port, {
rejectUnauthorized: false
}, common.mustCall(function() {
var cert = c.getPeerCertificate();
assert.equal(cert.subjectaltname,
'DNS:google.com\0.evil.com, ' +
'DNS:just-another.com, ' +
'IP Address:8.8.8.8, ' +
'IP Address:8.8.4.4, ' +
'DNS:last.com');
const cert = c.getPeerCertificate();
assert.strictEqual(cert.subjectaltname,
'DNS:google.com\0.evil.com, ' +
'DNS:just-another.com, ' +
'IP Address:8.8.8.8, ' +
'IP Address:8.8.4.4, ' +
'DNS:last.com');
c.write('ok');
}));
}));