diff --git a/lib/_tls_common.js b/lib/_tls_common.js index b8dce1ee1553ea..d6b989c3fd52ad 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -217,7 +217,8 @@ exports.createSecureContext = function createSecureContext(options) { // which leads to the crash later on. if (key) { if (ArrayIsArray(key)) { - for (const val of key) { + for (let i = 0; i < key.length; ++i) { + const val = key[i]; // eslint-disable-next-line eqeqeq const pem = (val != undefined && val.pem !== undefined ? val.pem : val); setKey(c.context, pem, val.passphrase || passphrase);