Skip to content

Allow renew time relative to the expiration date#4457

Merged
neilpang merged 5 commits intoacmesh-official:devfrom
AlexanderS:feature/relativ-renew
May 1, 2026
Merged

Allow renew time relative to the expiration date#4457
neilpang merged 5 commits intoacmesh-official:devfrom
AlexanderS:feature/relativ-renew

Conversation

@AlexanderS
Copy link
Copy Markdown
Contributor

You can now set a negative value for days, that will be subtracted from the expiration date of the generated certificate.

This will fix #3413.

@AlexanderS
Copy link
Copy Markdown
Contributor Author

I do not think, the error of the pipeline is related to the pull request.

@saudiqbal
Copy link
Copy Markdown

Any update on this PR?

@saudiqbal
Copy link
Copy Markdown

??? Nothing?

@heiko3
Copy link
Copy Markdown

heiko3 commented Jul 1, 2025

Unfortunately, there has been no response to the pull request yet. We've been using this change in production for a long time, and it works very well. Given the different expiration times for server certificates at different CAs, this is very helpful, and the expiration times will continue to change in the future, so this change is very important for automation.
It's a shame that the pull request hasn't been implemented yet.

@saudiqbal
Copy link
Copy Markdown

Looks like someone else needs to take over this project, acmesh-official is not doing anything for pull requests.

@lukastribus
Copy link
Copy Markdown

Ultimately #4944 ARI support is going to fulfill this need in most cases, I can see that the work has already began.

The change in this PR would still be useful nonetheless of course.

Copy link
Copy Markdown

@saudiqbal saudiqbal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please approve the PR for relative expiry date.

@saudiqbal
Copy link
Copy Markdown

PR still not accepted!

@AlexanderS
Copy link
Copy Markdown
Contributor Author

@neilpang Any comments on this? Did you maybe miss this PR by accident?

@neilpang
Copy link
Copy Markdown
Member

neilpang commented May 1, 2026

please also add thie usage in the showhelp() method, so that everyone knows it can be negative numbers.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for configuring certificate renewal scheduling relative to the certificate’s expiration date (by allowing negative Le_RenewalDays), addressing scenarios with long-lived certificates (e.g., 1-year ACME certs) as described in #3413.

Changes:

  • Introduces _enddate() to read notAfter from an issued certificate via OpenSSL.
  • Introduces _ssldate2time() to convert OpenSSL -enddate output into epoch seconds.
  • Updates next-renew-time calculation to support negative Le_RenewalDays as “expire time + (negative days)”.

Comment thread acme.sh Outdated
Comment thread acme.sh Outdated
Comment thread acme.sh Outdated
Comment thread acme.sh Outdated
@AlexanderS AlexanderS force-pushed the feature/relativ-renew branch from 3e601f5 to e081347 Compare May 1, 2026 13:37
@AlexanderS
Copy link
Copy Markdown
Contributor Author

I have updated the PR and included the various suggestions from Copilot (although the extensive error checking does not align with other parts of the code).

Alexander Sulfrian added 5 commits May 1, 2026 16:00
You can now set a negative value for days, that will be subtracted from
the expiration date of the generated certificate.
_enddate is also a function and it is better to use different names for
functions and variables for better maintainability.
@neilpang neilpang force-pushed the feature/relativ-renew branch from e081347 to 4c79890 Compare May 1, 2026 14:00
@neilpang neilpang merged commit e7ec2f0 into acmesh-official:dev May 1, 2026
34 of 36 checks passed
@AlexanderS AlexanderS deleted the feature/relativ-renew branch May 1, 2026 14:05
neilpang pushed a commit that referenced this pull request May 2, 2026
* Allow renew time relative to the expiration date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants