Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
f typo for...in to for...of
  • Loading branch information
trivikr committed Dec 14, 2019
commit c0cd5b21c87e0e0969d39dc37dcd33233959bca8
10 changes: 5 additions & 5 deletions lib/_tls_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ exports.createSecureContext = function createSecureContext(options) {
const { ca } = options;
if (ca) {
if (ArrayIsArray(ca)) {
for (const val in ca) {
for (const val of ca) {
validateKeyOrCertOption('ca', val);
c.context.addCACert(val);
}
Expand All @@ -120,7 +120,7 @@ exports.createSecureContext = function createSecureContext(options) {
const { cert } = options;
if (cert) {
if (ArrayIsArray(cert)) {
for (const val in cert) {
for (const val of cert) {
validateKeyOrCertOption('cert', val);
c.context.setCert(val);
}
Expand All @@ -138,7 +138,7 @@ exports.createSecureContext = function createSecureContext(options) {
const passphrase = options.passphrase;
if (key) {
if (ArrayIsArray(key)) {
for (const val in key) {
for (const val of key) {
// eslint-disable-next-line eqeqeq
const pem = (val != undefined && val.pem !== undefined ? val.pem : val);
validateKeyOrCertOption('key', pem);
Expand Down Expand Up @@ -237,7 +237,7 @@ exports.createSecureContext = function createSecureContext(options) {

if (options.crl) {
if (ArrayIsArray(options.crl)) {
for (const crl in options.crl) {
for (const crl of options.crl) {
c.context.addCRL(crl);
}
} else {
Expand All @@ -254,7 +254,7 @@ exports.createSecureContext = function createSecureContext(options) {
toBuf = require('internal/crypto/util').toBuf;

if (ArrayIsArray(options.pfx)) {
for (const pfx in options.pfx) {
for (const pfx of options.pfx) {
const raw = pfx.buf ? pfx.buf : pfx;
const buf = toBuf(raw);
const passphrase = pfx.passphrase || options.passphrase;
Expand Down