From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 1CDB41FF0B7 for ; Fri, 16 Oct 2026 14:45:37 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B499521580; Fri, 16 Oct 2026 14:45:31 +0200 (CEST) Content-Type: text/plain; charset=UTF-8 Date: Fri, 16 Oct 2026 14:45:26 +0200 Message-Id: From: =?utf-8?q?Michael_K=C3=B6ppl?= To: "David Riley" , Subject: Re: [PATCH pve-manager 2/2] fix #8006: api: acme: lifetime-based certificate renewal threshold Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 X-Mailer: aerc 0.22.0 References: <20261006123120.68750-1-d.riley@proxmox.com> <20261006123120.68750-3-d.riley@proxmox.com> In-Reply-To: <20261006123120.68750-3-d.riley@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792154726376 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.247 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: B7SHL5MISYM4WDTKRYJLEHBJKCTC66T4 X-Message-ID-Hash: B7SHL5MISYM4WDTKRYJLEHBJKCTC66T4 X-MailFrom: m.koeppl@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue Oct 6, 2026 at 2:31 PM CEST, David Riley wrote: > Replace the hardcoded 30-day renewal limit with a threshold based on > the certificate's actual lifetime. > > The previous hardcoded limit caused excessive daily renewals for > short-lived certificates (e.g., 31 days). This change ensures they > renew at sensible intervals, avoiding upstream rate limits. > > Link: https://bugzilla.proxmox.com/show_bug.cgi?id=3D8006 > > Signed-off-by: David Riley > --- > PVE/API2/ACME.pm | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/PVE/API2/ACME.pm b/PVE/API2/ACME.pm > index a948a72a..4f2590f0 100644 > --- a/PVE/API2/ACME.pm > +++ b/PVE/API2/ACME.pm > @@ -261,12 +261,15 @@ __PACKAGE__->register_method({ > raise("No current (custom) certificate found, please order a new= certificate!\n") > if !-e "${cert_prefix}.pem"; > > + my $lead_time =3D PVE::Certificate::get_cert_renew_lead_time("${= cert_prefix}.pem"); > + my $lead_days =3D int($lead_time / (24 * 60 * 60)); > + > my $expires_soon =3D > - PVE::Certificate::check_expiry("${cert_prefix}.pem", time() = + 30 * 24 * 60 * 60); > + PVE::Certificate::check_expiry("${cert_prefix}.pem", time() = + $lead_time); Should this perhaps also be done for bin/pveupdate? It still uses the hard-coded 30 days and the PBS patch you're referring to in the cover letter also updates its daily job. > raise_param_exc( > { > 'force' =3D> > - "Certificate does not expire within the next 30 days= , and 'force' is not set.", > + "Certificate does not expire within the next $lead_d= ays days, and 'force' is not set.", This should also be done for the description of the 'force' param. It still reads "... is more than 30 days away". > }, > ) if !$expires_soon && !$param->{force}; >