Skip to content

Commit

Permalink
fix: handle ssl from host array
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Jan 6, 2024
1 parent 11380ac commit fd45091
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,11 @@ class CoCreateAcme {
if (organization.error)
return false

if (!organization.host || !organization.host.includes(host))
return false

if (organization.host) {
for (let i = 0; i < host; i++) {
if (organization.host[i].name === hostname) {
let isHost
for (let i = 0; i < organization.host.length; i++) {
if (organization.host[i].name === host) {
isHost = true
if (organization.host[i].cert && organization.host[i].key) {
let expires = await forge.readCertificateInfo(organization.host[i].cert);
expires = expires.notAfter;
Expand All @@ -238,6 +237,9 @@ class CoCreateAcme {
break
}
}

if (!isHost)
return false
}

return await this.requestCertificate(host, organization_id, false)
Expand Down

0 comments on commit fd45091

Please sign in to comment.