From 7ec04d6d3d2de661242e8dd3ab6d251610ee217a Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Mon, 10 Feb 2020 20:36:01 +0000 Subject: [PATCH] fix(core): update --- ts/smartacme.classes.cert.ts | 2 +- ts/smartacme.classes.smartacme.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ts/smartacme.classes.cert.ts b/ts/smartacme.classes.cert.ts index 85e43d8..51f3ed5 100644 --- a/ts/smartacme.classes.cert.ts +++ b/ts/smartacme.classes.cert.ts @@ -41,7 +41,7 @@ export class Cert extends plugins.smartdata.SmartDataDbDoc implements plug plugins.smarttime.getMilliSecondsFromUnits({ days: 10 }); - return this.validUntil >= shouldBeValidAtLeastUntil; + return !(this.validUntil >= shouldBeValidAtLeastUntil); } public update(certDataArg: plugins.tsclass.network.ICert) { diff --git a/ts/smartacme.classes.smartacme.ts b/ts/smartacme.classes.smartacme.ts index d985962..bde9d8e 100644 --- a/ts/smartacme.classes.smartacme.ts +++ b/ts/smartacme.classes.smartacme.ts @@ -114,14 +114,17 @@ export class SmartAcme { const certDomainName = this.certmatcher.getCertificateDomainNameByDomainName(domainArg); const retrievedCertificate = await this.certmanager.retrieveCertificate(certDomainName); + const shouldberenewed = retrievedCertificate.shouldBeRenewed(); + const isStillValid = retrievedCertificate.isStillValid(); + if (!retrievedCertificate && await this.certmanager.interestMap.checkInterest(certDomainName)) { const existingCertificateInterest = this.certmanager.interestMap.findInterest(certDomainName); const certificate = existingCertificateInterest.interestFullfilled; return certificate; } else if (retrievedCertificate && !retrievedCertificate.shouldBeRenewed()) { return retrievedCertificate; - } else if (retrievedCertificate && retrievedCertificate.shouldBeRenewed) { - await retrievedCertificate.delete(); + } else if (retrievedCertificate && retrievedCertificate.shouldBeRenewed()) { + // await retrievedCertificate.delete(); } // lets make sure others get the same interest