ACME.js attempts to POST challenges repeatedly rather than GET the authorization status #9

Open
opened 2021-04-07 11:01:17 +00:00 by sam-lord · 2 comments

Noticed that when testing Greenlock.js against the Pebble ACME server (official testing server for ACME protocol), I received the following error repeatedly:

[acme-v2] mydomain.local status:400 Cannot update challenge with status valid, only status pending

It appears as though another ACME client had the same issue: https://github.com/letsencrypt/pebble/issues/133

Works without errors when used against live / staging, but the speed of localhost demonstrates the issue. The issue above explains the correct flow for these requests to avoid errors.

--

BTW, relative novice here w.r.t ACME & Greenlock

Noticed that when testing Greenlock.js against the Pebble ACME server (official testing server for ACME protocol), I received the following error repeatedly: >[acme-v2] mydomain.local status:400 Cannot update challenge with status valid, only status pending It appears as though another ACME client had the same issue: https://github.com/letsencrypt/pebble/issues/133 Works without errors when used against live / staging, but the speed of localhost demonstrates the issue. The issue above explains the correct flow for these requests to avoid errors. -- BTW, relative novice here w.r.t ACME & Greenlock
Author

Seems like this issue can be solved in ACME._postChallenge in the checkResult function by adding 'pending' to the possible states that result in pollStatus getting called. I'll submit a patch for this soon.

Subsequent error is that the finalize URL is called twice - if the ACME server validates the challenge in the initial call then any further calls will error with a 403 because you can't finalize an already valid certificate. Trying to determine whether there's a POST-as-GET alternative for ACME._pollOrderStatus - looking at other implementations

Seems like this issue can be solved in `ACME._postChallenge` in the `checkResult` function by adding 'pending' to the possible states that result in `pollStatus` getting called. I'll submit a patch for this soon. Subsequent error is that the finalize URL is called twice - if the ACME server validates the challenge in the initial call then any further calls will error with a 403 because you can't finalize an already valid certificate. Trying to determine whether there's a POST-as-GET alternative for `ACME._pollOrderStatus` - looking at other implementations
Author

SO ACME._pollOrderStatus should use the same GET on order._orderUrl as was used in ACME._postChallenge. I've made a patch for this locally and it works great.

I'll tidy it up a bit and create a PR.

SO `ACME._pollOrderStatus` should use the same GET on `order._orderUrl` as was used in `ACME._postChallenge`. I've made a patch for this locally and it works great. I'll tidy it up a bit and create a PR.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: root/acme.js#9
No description provided.