-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to check if certificate needs renewal without ordering a new one? #146
Comments
I think I get it now. If I create an order asking for a new Certificate and the status of the request comes back with |
No. If the certificate has the status This is a way to get the Example: Certificate cert = // the certificate that was freshly created
URL certLocation = cert.getLocation();
// store certLocation somewhere Then, as soon as you need the Login login = // your login
URL certLocation = // certLocation that was stored
Certificate cert = login.bindCertificate(certLocation);
RenewalInfo renewalInfo = cert.getRenewalInfo(); Anyhow I just realized that this way is unnecessary complicated. I will think about an improved way, which directly uses the Note that |
A better way (which still requires storing an URL though): Certificate cert = // the certificate that was freshly created
Optional<URL> renewalInfoLocation = cert.getRenewalInfoLocation();
// Store the renewalInfoLocation somewhere. Will be empty if renewalInfo is not supported. Then later: Login login = // your login
URL renewalInfoLocation = // renewalInfoLocation that was stored
RenewalInfo renewalInfo = login.bindRenewalInfo(renewalInfoLocation); The "improved way" which I mentioned above will not require to store an URL, but it will require |
My incentive for asking this question is that Let's Encrypt has rate limits of issuing 5 certificates per week (for the same domains). I don't want to cross this limit, but even time I deploy a new server to production it restarts acme4j and goes through the certificate renewal process all over again. At what step does acme4j ask for a new certificate? Is it
This way I wouldn't need to store the certificate anywhere. I would just download it on demand. Can you please update the example code and documentation (Javadoc and main doc) to tackle this use-case. Also, it would be helpful if you indicates that Thank you. |
With The ACME protocol provides a way to fetch all existing orders that are related to your account, and acme4j offers access to this information with So if you use Let's Encrypt, I see no other way than to either store the order or certificate URLs locally, or check your locally stored certificate for expiration. However, checking I will review the |
@shred What other services is acme4j compatible with? Does it support ZeroSSL? |
acme4j is designed to be a generic ACME client in first place, so it is compatible with all CAs that are RFC 8555 compliant. It is best tested with Let's Encrypt though. ZeroSSL should work. You can connect to their servers by using the |
Thank you. I will close this issue, seeing as ZeroSSL doesn't have rate limits. I will just issue a new certificate on every startup for now, and eventually I'll add state to the database to avoid unnecessary renews. |
When my server starts up it might already have a valid certificate. The only way I know of checking if renewal is needed is using
RenewalInfo
but the only way to get an instance is by having aCertificate
and the only way I know of getting one is by ordering a new one.I am sure I am overlooking something in the API. I read through the documentation and couldn't find a discussion of this use-case.
What am I supposed to do this in case?
The text was updated successfully, but these errors were encountered: