Fixed variable use before declaration

This commit is contained in:
Noah Zalev 2021-06-22 20:05:34 -04:00
parent 5552fb996b
commit c39cd2bf39
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ module.exports.CreateLetsEncrypt = function (parent) {
// Decode the certificate common and alt names // Decode the certificate common and alt names
obj.certNames = [cert.subject.getField('CN').value]; obj.certNames = [cert.subject.getField('CN').value];
var altNames = cert.getExtension('subjectAltName'); 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 // Decode the certificate expire time
obj.certExpire = cert.validity.notAfter; obj.certExpire = cert.validity.notAfter;