From efb56ef58ee201466ee8185bae42bdb46bbaf4b4 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Sun, 5 Apr 2026 11:27:27 +0000 Subject: [PATCH] feat(smartacme): add forceRenew option to bypass cached certificate reuse during issuance --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts/smartacme.classes.smartacme.ts | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 8c1fc27..ec820f0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2026-04-05 - 9.5.0 - feat(smartacme) +add forceRenew option to bypass cached certificate reuse during issuance + +- adds a forceRenew flag to certificate issuance input handling +- skips the cached valid-certificate check when forceRenew is enabled + ## 2026-04-03 - 9.4.0 - feat(smartacme) add forceRenew option for certificate issuance requests diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index d2a32f9..ce46b77 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartacme', - version: '9.4.0', + version: '9.5.0', description: 'A TypeScript-based ACME client and server for certificate management with built-in CA, supporting LetsEncrypt and custom ACME authorities.' } diff --git a/ts/smartacme.classes.smartacme.ts b/ts/smartacme.classes.smartacme.ts index 47b9aa6..4c4dc7a 100644 --- a/ts/smartacme.classes.smartacme.ts +++ b/ts/smartacme.classes.smartacme.ts @@ -11,6 +11,7 @@ interface ICertIssuanceInput { domainArg: string; isWildcardRequest: boolean; includeWildcard: boolean; + forceRenew: boolean; } const CERT_ISSUANCE_STEPS = [ @@ -159,6 +160,7 @@ export class SmartAcme { }, shouldExecute: async (_task, input?: ICertIssuanceInput) => { if (!input?.certDomainName || !this.certmanager) return true; + if (input.forceRenew) return true; // Safety net: if a valid cert is already cached, skip re-issuance const existing = await this.certmanager.retrieveCertificate(input.certDomainName); if (existing && !existing.shouldBeRenewed()) { @@ -397,6 +399,7 @@ export class SmartAcme { domainArg, isWildcardRequest, includeWildcard: options?.includeWildcard ?? false, + forceRenew, }; const result = await this.taskManager.triggerTaskConstrained(