summaryrefslogtreecommitdiff
path: root/test/parallel/test-tls-peer-certificate-encoding.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-tls-peer-certificate-encoding.js')
-rw-r--r--test/parallel/test-tls-peer-certificate-encoding.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/parallel/test-tls-peer-certificate-encoding.js b/test/parallel/test-tls-peer-certificate-encoding.js
index b59d10faa7..545caf403e 100644
--- a/test/parallel/test-tls-peer-certificate-encoding.js
+++ b/test/parallel/test-tls-peer-certificate-encoding.js
@@ -1,32 +1,32 @@
'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');
-var util = require('util');
-var join = require('path').join;
+const fs = require('fs');
+const util = require('util');
+const join = require('path').join;
-var options = {
+const options = {
key: fs.readFileSync(join(common.fixturesDir, 'keys', 'agent5-key.pem')),
cert: fs.readFileSync(join(common.fixturesDir, 'keys', 'agent5-cert.pem')),
ca: [ fs.readFileSync(join(common.fixturesDir, 'keys', 'ca2-cert.pem')) ]
};
-var server = tls.createServer(options, function(cleartext) {
+const server = tls.createServer(options, function(cleartext) {
cleartext.end('World');
});
server.listen(0, common.mustCall(function() {
- var socket = tls.connect({
+ const socket = tls.connect({
port: this.address().port,
rejectUnauthorized: false
}, common.mustCall(function() {
- var peerCert = socket.getPeerCertificate();
+ const peerCert = socket.getPeerCertificate();
console.error(util.inspect(peerCert));
assert.equal(peerCert.subject.CN, 'Ádám Lippai');