Skip to content

acme: support standards-compliant order finalization (cherry-pick b4dcfb54b) - #9

Merged
cert-manager-prow[bot] merged 1 commit into
masterfrom
acme-create-cert-from-order
Oct 10, 2026
Merged

cert-manager-prow[bot] merged 1 commit into
masterfrom
acme-create-cert-from-order

Conversation

@wallrj-cyberark

@wallrj-cyberark wallrj-cyberark commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

This cherry-picks golang/crypto b4dcfb5 ("acme: support standards-compliant order finalization") onto our fork. It adds Client.CreateCertFromOrder, which polls the order's own URI after finalize instead of the finalize response's Location header. RFC 8555 does not require that header, and Pebble v2.9.0+ omits it.

cert-manager needs this now. Its e2e Pebble omits the header, so every ACME finalize in e2e first fails with Post "": unsupported protocol scheme "" and is retried. The retry sometimes finalizes the same order twice and fails the test. The cert-manager PR that consumes this commit is cert-manager/cert-manager#9430.

The cherry-pick applied cleanly. A full sync with golang/crypto master is a bigger job, because upstream has since added its own ACME profiles support (4e01a84), which overlaps with this fork's profiles patch.

Please merge with a merge commit, not squash or rebase. cert-manager's third_party/klone.yaml pins a0b1a2d, which must stay reachable from master.

How this was tested
  • go test ./acme/... passes on this branch, including TestWithPebble against Pebble v2.10.1.

  • On master with only the Pebble version bumped to v2.10.1, TestWithPebble fails with the same error cert-manager sees:

    failed to finalize order https://127.0.0.1:5561/my-order/... with finalize URL https://127.0.0.1:5561/finalize-order/...: Post "": unsupported protocol scheme ""
    

[with Claude]

When an order finalization response is not immediately valid,
Client.CreateOrderCert depends on the ACME server returning a Location
header. The header value is used as the URL for polling the updated
order status. RFC 8555 does not require this header, so CreateOrderCert
does not interoperate with ACME servers that omit it (e.g. Pebble
v2.9.0+).

This commit adds Client.CreateCertFromOrder, which accepts an *Order and
uses its URI for polling instead of relying on the finalization
response's Location header. It also updates existing callers and
documentation to use the new method and updates the integration tests to
Pebble v2.10.1 (the latest available version), which omits the
finalization Location header.

Fixes golang/go#77704

Change-Id: I0852f19c5d18d6debc9c9686fa2c14a2e39663c2
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/817000
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
(cherry picked from commit b4dcfb5)
Signed-off-by: Richard Wall <richard.wall@cyberark.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused implementation matches the reviewed upstream change and includes unit and integration coverage; only a minor documentation typo remains.

1 open finding
What changed in this PR

Cherry-picks upstream ACME finalization support so clients poll the order URI without requiring a non-standard Location header.

Changes:

  • Adds CreateCertFromOrder and order-URI fallback handling.
  • Migrates internal callers to the standards-compliant API.
  • Updates unit and Pebble integration coverage.
File Description
acme/​rfc8555.go Implements order-based certificate finalization.
acme/​rfc8555_test.go Tests missing Location headers and invalid orders.
acme/​pebble_test.go Updates Pebble and exercises the new API.
acme/​types.go Updates order documentation.
acme/​acme.go Updates deprecated API guidance.
acme/​autocert/​autocert.go Migrates automatic issuance.
acme/​internal/​acmeprobe/​prober.go Migrates probe issuance flows.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread acme/rfc8555.go
@wallrj

wallrj commented Oct 9, 2026

Copy link
Copy Markdown
Member

I compared the diff against upstream golang/crypto b4dcfb5. The code change is identical; only the hunk offsets differ because of our profiles, ARI and RetryAfter patches. No CreateOrderCert callers remain in this repo, and the -dns01 to -dnsserver flag rename matches pebble-challtestsrv v2.10.1.

One thing for whoever merges: use "Create a merge commit". cert-manager/cert-manager#9430 pins the head commit a0b1a2d, and a squash or rebase would leave it unreachable from master.

[Claude Fable 5.1]

@wallrj
wallrj requested a review from hjoshi123 October 9, 2026 16:21
@hjoshi123

Copy link
Copy Markdown

/label tide/merge-method-merge

@cert-manager-prow

Copy link
Copy Markdown

@hjoshi123: The label(s) tide/merge-method-merge cannot be applied, because the repository doesn't have them.

Details

In response to this:

/label tide/merge-method-merge

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@hjoshi123

Copy link
Copy Markdown

/lgtm

@cert-manager-prow

Copy link
Copy Markdown

@hjoshi123: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@cert-manager-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: hjoshi123

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow
cert-manager-prow Bot merged commit 9db813b into master Oct 10, 2026
3 checks passed
@wallrj-cyberark
wallrj-cyberark deleted the acme-create-cert-from-order branch October 10, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants