-
Notifications
You must be signed in to change notification settings - Fork 16
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
Let's Encrypt may be down for maintenance or directoryUrl
may be wrong
#1
Comments
Fail early. If someone is starting the server with incorrect settings, we want them to know right away.
No. It caches the directory URL so that it doesn't fetch it again for at least an hour (as opposed to every time it's needed).
I think that it would be reasonable to make the default behavior to log the error and to continue rather than throw, now that the use case is better understood. |
Thanks. IIUC, if we remove this // @root/greenlock/greenlock.js:393
await acme.init(dirUrl).catch(function(err) {
// TODO this is a special kind of failure mode. What should we do?
console.error(
"[debug] Let's Encrypt may be down for maintenance or `directoryUrl` may be wrong"
);
// throw err; // <--- this
}); and the call to ACME v2 does fail, then the metadata won't be initialized: // @root/acme.js:69
me.init = function (opts) {
// ...
function fin(dir) {
me._directoryUrls = dir; // <--- this won't run
me._tos = dir.meta.termsOfService; // <--- and this
return dir;
} Which means // @root/acme.js:1145
ACME._orderCert = function (me, options, kid) {
// ...
return U._jwsRequest(me, {
url: me._directoryUrls.newOrder, // <--- this will be missing Alternatively, we can ping ACME v2 periodically (every 1 hour?) until it is back up. That said, I'm not sure if I think I get the general idea, so I can write up a PR if this makes sense. |
Is there a setting that would allow the server to start even though let's encrypt API is down for maintenance? I did have a valid cert also and had to restart node and now the server is just down. Would love to prevent this in the future. |
This appears to be biting me today during an LE outage - had to restart Node for unrelated reasons and now the site is just down. Definitely would be nice for this module to handle such situations more gracefully. |
While the main API endpoint is down I was able to bring my server back up by temporarily switching to the staging API directory endpoint (since the cert is still valid this did not appear to have any unintended side effects, for now). |
I'm convinced that this is a problem that needs to be solved. Would someone like to make a PR, test it, and ping me? |
Earlier this week (Monday, Apr 26 around 12:30 ET) Let's Encrypt was undergoing maintenance and its ACME v2 URL https://acme-v02.api.letsencrypt.org/directory was returning an error. I have
greenlock-express
set up with a valid cert (issued in March, expiring in June). I needed to restart Node but I got the following error:It seems that greenlock pings the ACME endpoint every 1 hour, is that correct? From
@root/greenlock/greenlock.js:387
:I don't fully understand the intent here but my question is - if the cert is still valid (in my case, it's expiring in June), a. why is it necessary to ping the ACME endpoint, and b. why does this ping prevent the Node server from starting (again, despite a valid cert)?
Expected: given a valid cert, greenlock should start the Node server.
Actual: given a valid cert, greenlock fails to start because ACME v2 endpoint is unavailable.
Packages:
@root/greenlock
v4.0.5
@root/acme
v3.1.0
@root/greenlock-express
v4.0.4
Thank you.
The text was updated successfully, but these errors were encountered: