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 43D9E1FF0B7 for ; Fri, 16 Oct 2026 15:17:50 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BBD5A21582; Fri, 16 Oct 2026 15:17:40 +0200 (CEST) Message-ID: Date: Fri, 16 Oct 2026 15:17:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH pve-manager 2/2] fix #8006: api: acme: lifetime-based certificate renewal threshold To: =?UTF-8?Q?Michael_K=C3=B6ppl?= , pve-devel@lists.proxmox.com References: <20261006123120.68750-1-d.riley@proxmox.com> <20261006123120.68750-3-d.riley@proxmox.com> Content-Language: en-US From: David Riley In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792156655888 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.726 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: 6PHW4X6W3Y3JHG52EL53QH7U674BSPON X-Message-ID-Hash: 6PHW4X6W3Y3JHG52EL53QH7U674BSPON X-MailFrom: d.riley@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 10/16/26 2:45 PM, Michael Köppl wrote: > 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=8006 >> >> 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 = PVE::Certificate::get_cert_renew_lead_time("${cert_prefix}.pem"); >> + my $lead_days = int($lead_time / (24 * 60 * 60)); >> + >> my $expires_soon = >> - 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. Missed that thanks. Will update this and the force parameter description in v2. >> raise_param_exc( >> { >> 'force' => >> - "Certificate does not expire within the next 30 days, and 'force' is not set.", >> + "Certificate does not expire within the next $lead_days 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}; >> > > > > >