aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-tls-honorcipherorder.js
diff options
context:
space:
mode:
authorGibson Fahnestock <gib@uk.ibm.com>2017-01-08 13:19:00 +0000
committerGibson Fahnestock <gib@uk.ibm.com>2017-01-11 11:43:52 +0000
commit7a0e462f9facfff8ccd7b37eb5b65db1c2b2f55f (patch)
treea971102d320e17e6cb3d00c48fe708b2b86c8136 /test/parallel/test-tls-honorcipherorder.js
parent1ef401ce92d6195878b9d041cc969612628f5852 (diff)
downloadandroid-node-v8-7a0e462f9facfff8ccd7b37eb5b65db1c2b2f55f.tar.gz
android-node-v8-7a0e462f9facfff8ccd7b37eb5b65db1c2b2f55f.tar.bz2
android-node-v8-7a0e462f9facfff8ccd7b37eb5b65db1c2b2f55f.zip
test: use eslint to fix var->const/let
Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'test/parallel/test-tls-honorcipherorder.js')
-rw-r--r--test/parallel/test-tls-honorcipherorder.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/parallel/test-tls-honorcipherorder.js b/test/parallel/test-tls-honorcipherorder.js
index 883abc199e..f7894e4670 100644
--- a/test/parallel/test-tls-honorcipherorder.js
+++ b/test/parallel/test-tls-honorcipherorder.js
@@ -9,19 +9,19 @@ if (!common.hasCrypto) {
const tls = require('tls');
const fs = require('fs');
-var nconns = 0;
+let nconns = 0;
// We explicitly set TLS version to 1.2 so as to be safe when the
// default method is updated in the future
-var SSL_Method = 'TLSv1_2_method';
-var localhost = '127.0.0.1';
+const SSL_Method = 'TLSv1_2_method';
+const localhost = '127.0.0.1';
process.on('exit', function() {
assert.equal(nconns, 6);
});
function test(honorCipherOrder, clientCipher, expectedCipher, cb) {
- var soptions = {
+ const soptions = {
secureProtocol: SSL_Method,
key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'),
cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'),
@@ -30,7 +30,7 @@ function test(honorCipherOrder, clientCipher, expectedCipher, cb) {
honorCipherOrder: !!honorCipherOrder
};
- var server = tls.createServer(soptions, function(cleartextStream) {
+ const server = tls.createServer(soptions, function(cleartextStream) {
nconns++;
// End socket to send CLOSE_NOTIFY and TCP FIN packet, otherwise
@@ -38,7 +38,7 @@ function test(honorCipherOrder, clientCipher, expectedCipher, cb) {
cleartextStream.end();
});
server.listen(0, localhost, function() {
- var coptions = {
+ const coptions = {
rejectUnauthorized: false,
secureProtocol: SSL_Method
};
@@ -46,8 +46,8 @@ function test(honorCipherOrder, clientCipher, expectedCipher, cb) {
coptions.ciphers = clientCipher;
}
const port = this.address().port;
- var client = tls.connect(port, localhost, coptions, function() {
- var cipher = client.getCipher();
+ const client = tls.connect(port, localhost, coptions, function() {
+ const cipher = client.getCipher();
client.end();
server.close();
assert.equal(cipher.name, expectedCipher);