Know if lego actually renewed the certificate ? #1493
-
Hello, I did not find if it is already possible, if so I apologize. This is the use case : Let's say I set up renew command every week (crontab or else), if my certificate is renewed I would need to restart my HTTP server but if not (because current certificate validity exceeds 30 days) I would not restart it to not cause any unnecessary unavailability. Thanks for reading. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello, Your use case is not clear but I will try to answer. You can use the And the hook to restart your server only if needed: |
Beta Was this translation helpful? Give feedback.
-
Hi, we're using the HTTP-01 Challenge with an on-premises ACME server, employing lego (with the --http renew command) for our clients. Some of our servers are running Apache and other applications that occupy port 80. Is there a way to stop these services only when a certificate renewal is necessary. I've already created an Ansible playbook for this purpose. Is there any built-in functionality in lego that could automate this process? thanks |
Beta Was this translation helpful? Give feedback.
Hello,
Your use case is not clear but I will try to answer.
You can use the
renew
command:https://go-acme.github.io/lego/usage/cli/examples/#to-renew-the-certificate
And the hook to restart your server only if needed:
https://go-acme.github.io/lego/usage/cli/examples/#to-renew-the-certificate-and-hook