lib: make c, ca and certs const in _tls_common

PR-URL: https://github.com/nodejs/node/pull/20073
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Daniel Bevenius
2018-04-16 14:59:51 +02:00
committed by James M Snell
parent 6348ec869f
commit beaa7bb671

View File

@@ -88,7 +88,7 @@ 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;
@@ -96,7 +96,7 @@ exports.createSecureContext = function createSecureContext(options, context) {
// 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) {
@@ -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) {