From c39cd2bf39e69a968a7a671fc70e797a027caf71 Mon Sep 17 00:00:00 2001 From: Noah Zalev Date: Tue, 22 Jun 2021 20:05:34 -0400 Subject: [PATCH] Fixed variable use before declaration --- letsencrypt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt.js b/letsencrypt.js index 68cf4bf4..13e58421 100644 --- a/letsencrypt.js +++ b/letsencrypt.js @@ -91,7 +91,7 @@ module.exports.CreateLetsEncrypt = function (parent) { // Decode the certificate common and alt names obj.certNames = [cert.subject.getField('CN').value]; var altNames = cert.getExtension('subjectAltName'); - if (altNames) { for (i = 0; i < altNames.altNames.length; i++) { var acn = altNames.altNames[i].value.toLowerCase(); if (obj.certNames.indexOf(acn) == -1) { obj.certNames.push(acn); } } } + if (altNames) { for (var i = 0; i < altNames.altNames.length; i++) { var acn = altNames.altNames[i].value.toLowerCase(); if (obj.certNames.indexOf(acn) == -1) { obj.certNames.push(acn); } } } // Decode the certificate expire time obj.certExpire = cert.validity.notAfter;