Skip to content

Retry without replaces-field when appropriate#50

Merged
mholt merged 2 commits into
mholt:masterfrom
oliverpool:retry-without-replace
Feb 12, 2026
Merged

Retry without replaces-field when appropriate#50
mholt merged 2 commits into
mholt:masterfrom
oliverpool:retry-without-replace

Conversation

@oliverpool
Copy link
Copy Markdown
Contributor

@oliverpool oliverpool commented Jan 8, 2026

Fixes caddyserver/certmagic#361

This is more of a workaround, but apparently the spec expects the server to reject orders when a certificate has already been replaced. So the client should retry: ietf-wg-acme/acme-ari#56 (comment) (via caddyserver/certmagic#364 (comment))

Copy link
Copy Markdown
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

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

I like this approach much better. Does it work for you?

@oliverpool
Copy link
Copy Markdown
Contributor Author

I did not test it. To unblock my situation, I disabled ARI for now (so I have a valid certificate and cannot reproduce the issue).

Ideally I can add a unittest to this PR. I saw that https://github.com/letsencrypt/pebble is made for this.
Unfortunately it does not implement alreadyReplaced properly yet... I am looking into implementing it there.

@oliverpool
Copy link
Copy Markdown
Contributor Author

I added a test.
This is currently failing until letsencrypt/pebble#532 is merged (and go.mod updated).

To test locally, clone my fork and use the replace directive in go.mod:

replace github.com/letsencrypt/pebble/v2 => /path/to/your/clone/with/my/pr

Comment thread go.mod
@oliverpool oliverpool force-pushed the retry-without-replace branch from 1f2885e to a048b85 Compare January 15, 2026 09:16
@oliverpool oliverpool force-pushed the retry-without-replace branch from a048b85 to ae28ddd Compare January 17, 2026 09:57
Copy link
Copy Markdown
Contributor Author

@oliverpool oliverpool left a comment

Choose a reason for hiding this comment

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

@mholt the pebble PR has been merged and I updated the dependencies accordingly (the change is not included in a tagged pebble release yet).

So running the tests on 189769b fails, but they succeed with ae28ddd

Comment thread go.mod
@mholt
Copy link
Copy Markdown
Owner

mholt commented Jan 28, 2026

Thanks!! Sorry for the delay on this, life's been crazy. Will circle back soon

Copy link
Copy Markdown
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Thanks for this, @oliverpool -- sorry for my absurdly long response time.

Let's give it a try!

@mholt mholt merged commit ddffee8 into mholt:master Feb 12, 2026
@oliverpool oliverpool deleted the retry-without-replace branch February 12, 2026 19:20
@oliverpool
Copy link
Copy Markdown
Contributor Author

No need to apologize, hope life is a bit less crazy now.

Thank you for all the efforts you invest in the https/acme/go ecosystem!

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.

HTTP 409 "Conflict" when the certificate identified by 'replaces' has already been replaced

2 participants