public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: David Riley <d.riley@proxmox.com>
To: "Michael Köppl" <m.koeppl@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH pve-common 1/2] certificate: add helpers for lifetime-based ACME renewal
Date: Fri, 16 Oct 2026 15:17:33 +0200	[thread overview]
Message-ID: <3a8341b3-452c-4f12-b1e4-f2d7b8615b42@proxmox.com> (raw)
In-Reply-To: <DM69TSMMNTVT.RVQXMFWI4Q0A@proxmox.com>


On 10/16/26 2:45 PM, Michael Köppl wrote:
> On Tue Oct 6, 2026 at 2:31 PM CEST, David Riley wrote:
>
> [snip]
>
>> +sub get_cert_renew_lead_time {
>> +    my ($cert_path) = @_;
>> +
>> +    my $default_lead = 30 * 24 * 60 * 60;
>> +
>> +    my $not_before = get_not_before_as_epoch($cert_path);
>> +    my $not_after = get_expiration_as_epoch($cert_path);
>> +
>> +    my $lifetime = $not_after - $not_before;
>> +    return $default_lead if $lifetime <= 0;
>> +
>> +    my $scale = $lifetime < (10 * 24 * 60 * 60) ? 2 : 3;
>> +
>> +    return int($lifetime / $scale);
> The scaling mirrors what's done in PBS, but shouldn't this also have
> the 3-day floor that PBS has? AFAICT from the original series, the this
> floor was applied as it was in v1, so as part of the helper function, so
> it should probably also go here.
>
> If I understand Shannon's comment [0] on the original series correctly,
> for short-lived certificates (e.g. 48h) the renewal window (in this case
> 24h) might be shorter than the time between pveupdate runs and renewal
> might fail because of that. I'm able to reproduce this using `faketime`.
>
> Or is there a reason this was ommitted?
>
> [0] https://lore.proxmox.com/pbs-devel/DHZKEJBTPLZY.TNSL8CWILFKT@proxmox.com/
>

You are right this should have definitely be included here as well.
Seems like I have missed that part when looking at the pbs series.
Thanks for the heads up, I will correct that in a v2.


>> +}
>> +
>>   # Create a CSR and certificate key for a given order
>>   # returns path to CSR file or path to CSR and key files
>>   sub generate_csr {
>
>
>
>
>




  reply	other threads:[~2026-10-16 13:17 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 [this message]
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
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=3a8341b3-452c-4f12-b1e4-f2d7b8615b42@proxmox.com \
    --to=d.riley@proxmox.com \
    --cc=m.koeppl@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal