Repository navigation
mod_md: Honour the Retry-After header of ACME responses (BZ 70282) - #868
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
Add ap_parse_retry_after() to parse the value of a Retry-After header, either delay-seconds or an HTTP-date as defined in RFC 9110, section 5.6.7. mod_md uses it as RFC 8555 recommends: when polling orders and authorizations, after finalizing an order and when a request is rate limited. A hint beyond the timeout is waited for only until the deadline, and the wait ends early on shutdown. a2md does not link httpd and carries its own copy of the parser. PR 70282.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugzilla: https://bz.apache.org/bugzilla/show_bug.cgi?id=70282
mod_md ignores the Retry-After header of ACME responses. RFC 8555 recommends honouring it, and ignoring it makes mod_md race against pebble in CI.
This adds ap_parse_retry_after() to the core. It accepts delay-seconds or an HTTP-date in any of the three formats of RFC 9110, section 5.6.7, and rejects everything else, such as time zones other than GMT, text after the date, or lists. An HTTP-date is read against the Date header of the response, so a skewed server clock does not matter. The day name is checked for its syntax only, as RFC 9110 does not require rejecting an inconsistent one.
mod_md uses it when polling orders and authorizations, after the challenge POST and the finalize response, and on rate limited errors, where the job is rescheduled no earlier than the CA asked, capped at one day. A hint beyond the timeout is waited for only until the deadline, then one last poll is made. The wait ends early when the server stops or restarts, and such a cancelled run is not counted as a renewal error.
Validated on Linux:
Limits of this validation:
The new tests are libcheck unit tests in test/unit/util.c, not pyhttpd tests. The existing test/modules/md suite covers the mod_md side.
(see
SECURITY.mdandhttps://www.apache.org/security/#reporting-a-vulnerability).
APLOGNO()tag;numbers are assigned by a committer at merge time (see
docs/log-message-tags/README).changes-entries/*.txtfile is included,following the template in
README.CHANGES(not needed otherwise).test/modules/xxxdirectory matching themodules/xxxmodule source,or
test/modules/corefor core server changes. On Unix, verify thesepass locally with e.g.
make check-pytest PYTEST_DIRS=test/modules/xxx.