all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Michael Köppl" <m.koeppl@proxmox.com>
To: "David Riley" <d.riley@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH pve-manager 2/2] fix #8006: api: acme: lifetime-based certificate renewal threshold
Date: Fri, 16 Oct 2026 14:45:26 +0200	[thread overview]
Message-ID: <DM69TVEZU4E5.F6BFX8OP75J3@proxmox.com> (raw)
In-Reply-To: <20261006123120.68750-3-d.riley@proxmox.com>

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 <d.riley@proxmox.com>
> ---
>  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.

>          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};
>






  reply	other threads:[~2026-10-16 12:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06 12:31 [PATCH common/manager 0/2] fix #8006: acme: lifetime-based certificate renewal threshold David Riley
2026-10-06 12:31 ` [PATCH pve-common 1/2] certificate: add helpers for lifetime-based ACME renewal David Riley
2026-10-16 12:45   ` Michael Köppl
2026-10-16 13:17     ` David Riley
2026-10-06 12:31 ` [PATCH pve-manager 2/2] fix #8006: api: acme: lifetime-based certificate renewal threshold David Riley
2026-10-16 12:45   ` Michael Köppl [this message]
2026-10-16 13:17     ` David Riley
2026-10-16 12:45 ` [PATCH common/manager 0/2] fix #8006: " Michael Köppl
2026-10-16 13:17   ` David Riley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM69TVEZU4E5.F6BFX8OP75J3@proxmox.com \
    --to=m.koeppl@proxmox.com \
    --cc=d.riley@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal