Skip to content

Commit

Permalink
lib: make c, ca and certs const in _tls_common
Browse files Browse the repository at this point in the history
PR-URL: #20073
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
danbev authored and jasnell committed Apr 19, 2018
1 parent 6348ec8 commit beaa7bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/_tls_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ exports.createSecureContext = function createSecureContext(options, context) {
if (options.honorCipherOrder)
secureOptions |= SSL_OP_CIPHER_SERVER_PREFERENCE;

var c = new SecureContext(options.secureProtocol, secureOptions, context);
const c = new SecureContext(options.secureProtocol, secureOptions, context);
var i;
var val;

if (context) return c;

// NOTE: It's important to add CA before the cert to be able to load
// cert's issuer in C++ code.
var ca = options.ca;
const { ca } = options;
if (ca) {
if (Array.isArray(ca)) {
for (i = 0; i < ca.length; ++i) {
Expand All @@ -112,7 +112,7 @@ exports.createSecureContext = function createSecureContext(options, context) {
c.context.addRootCerts();
}

var cert = options.cert;
const { cert } = options;
if (cert) {
if (Array.isArray(cert)) {
for (i = 0; i < cert.length; ++i) {
Expand Down

0 comments on commit beaa7bb

Please sign in to comment.