Skip to content

ARI - Add support for switching ACME Server during renewal#6983

Merged
neilpang merged 2 commits into
acmesh-official:devfrom
sim0n-v:patch-3
May 24, 2026
Merged

ARI - Add support for switching ACME Server during renewal#6983
neilpang merged 2 commits into
acmesh-official:devfrom
sim0n-v:patch-3

Conversation

@sim0n-v

@sim0n-v sim0n-v commented May 24, 2026

Copy link
Copy Markdown
Contributor

Fix for #6964

Following the initial ACME RFC Section 9.7.4:

  • Error Type starts with: urn:ietf:params:acme:error:
  • Error Type ends in particular with (ref):
    • alreadyReplaced
    • malformed

This PR add support of exact Error Types urn:ietf:params:acme:error:alreadyReplaced and urn:ietf:params:acme:error:malformed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates ARI renewal handling in acme.sh so that when a CA rejects an order containing the RFC 9773 replaces field, the client retries newOrder without replaces—specifically targeting CAs that return ACME RFC8555/IANA error types like alreadyReplaced and malformed (per issue #6964).

Changes:

  • Adjusted the retry trigger to look for exact ACME error type URNs (...:alreadyReplaced, ...:malformed) after a failed newOrder with replaces.

Critical Issues (Must Fix Before Merge)

  • The new condition narrows behavior and no longer matches the nearby comment (“mentions ARI or the replaces field”), potentially regressing cases previously handled by the broader heuristics. (See PR comment.)

Suggestions (Improvements to Consider)

  • None beyond the requested changes.

Good Practices (Points to Commend)

  • None noted.

Comment thread acme.sh Outdated
Comment on lines +4894 to +4898
@@ -4895,7 +4895,7 @@ issue() {
# (Let's Encrypt) may also reject with a malformed error if the prior cert
# was issued by a different issuer / different CA. Retry without "replaces"
# whenever the failure mentions ARI or the replaces field.
if [ "$_replaces_certID" ] && { _contains "$response" "alreadyReplaced" || _contains "$response" "'replaces'" || _contains "$response" "ARI"; }; then
if [ "$_replaces_certID" ] && { _contains "$response" "urn:ietf:params:acme:error:alreadyReplaced" || _contains "$response" "urn:ietf:params:acme:error:malformed"; }; then
@neilpang

Copy link
Copy Markdown
Member

just add urn:ietf:params:acme:error:malformed don't change the existing values

@neilpang neilpang merged commit d9ce7fe into acmesh-official:dev May 24, 2026
33 of 36 checks passed
@sim0n-v

sim0n-v commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

Done.

I still think that it should be the same format:

  • urn:ietf:params:acme:error:malformed vs malformed
  • urn:ietf:params:acme:error:alreadyReplaced vs alreadyReplaced
    For now we have both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants