Skip to content

Support custom ACME providers#620

Open
NiccoMlt wants to merge 10 commits into
diennea:536-bump-acme4jfrom
NiccoMlt:536-acme-certificate-support-custom-acme-providers
Open

Support custom ACME providers#620
NiccoMlt wants to merge 10 commits into
diennea:536-bump-acme4jfrom
NiccoMlt:536-acme-certificate-support-custom-acme-providers

Conversation

@NiccoMlt

Copy link
Copy Markdown
Contributor

Implementation

Certificates can now be issued by any RFC 8555 compliant CA, not just Let's Encrypt.

Closes #536. Stacked on #619 so merge that first.

Caution

CI mocks the ACME boundary, so external account binding and custom directory URLs are not exercised end-to-end; QA will verify against a real provider. A local run against Pebble) is a meaningful smoke check.

Configuration

Providers are configured with a new configuration family and referenced per certificate:

acme.1.name=digicert
acme.1.url=https://acme.digicert.com/v2/acme/directory
# external account binding credentials (both or neither), as provided by the CA
acme.1.kid=your-key-identifier
acme.1.hmac=your-base64-encoded-hmac-key

certificate.3.hostname=myhostname.example.com
certificate.3.mode=acme
certificate.3.provider=digicert

If no provider is specified, Let's Encrypt is used, as before. Therefore, the letsencrypt name is reserved for the built-in provider.

kid and hmac are optional, but both-or-neither; those allow logging in with EAB (External Account Binding) credentials, if required by the provider.

Built-in letsencrypt provider still stores the account key under the legacy _acmeuserkey entry, while custom providers use _acmeuserkey_<name>, e.g. _acmeuserkey_digicert.

Important

carapace.acme.testmode JVM system property keeps affecting only the built-in Let's Encrypt provider (staging vs production); custom providers always use their configured URL.

REST APIs

  • POST /api/certificates accepts provider too.
  • POST /api/certificates/{domain}/upload accepts provider query param too (ACME type only);
  • GET /api/certificates exposes each certificate's provider
    • it also exposes acmeProviders, that feeds the UI select.

Web UI

  • added provider select in the certificate creation form;
  • added provider column in the list;
  • added provider row in the detail view.

NiccoMlt added 7 commits July 22, 2026 12:18
Replace deprecated update() with fetch() on challenge and order polling,
as recommended by the acme4j migration guide before upgrading to 4.x.
No code changes needed: deprecated APIs were already dropped in the 3.5.0
step, and the new Java 17 baseline is below our Java 21 build.
Login.getKeyPair() was removed as a security precaution: private key
handling now stays inside acme4j, and only Login.getPublicKey() is
exposed. Tests now stub getPublicKey(), which the challenge digest
computation relies on.
Align slf4j with the version acme4j 5.1.0 builds against.
acme4j's Authorization.findChallenge(Class) makes the manual casts
unnecessary.
checkResponseForChallenge and checkResponseForOrder returned the status
read before fetch(), so callers always saw the stale value and the
certificate state machine converged one cycle late. Return the
post-fetch status instead, and cover the polling logic with direct
ACMEClient tests.
@NiccoMlt NiccoMlt self-assigned this Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d092e690-5ceb-4bc5-a28d-14c215a62a47

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

NiccoMlt added 3 commits July 23, 2026 15:26
Any RFC 8555 CA via acme.<n>.* config (EAB kid/hmac supported,
validated at parse time), per-certificate provider selection,
per-provider account keys. Let's Encrypt stays default with the
legacy account key.

Closes diennea#536
CA rejections (stale orders, malformed responses) bump the cert
attempts and fall back to a fresh order; network errors, rate
limits and CA outages retry in the same state. Order polls fetch
once per cycle. Policy lives in AcmeFailureClassifier with fast
pure unit tests replacing five heavy harness runs.
Unknown local failures now bump attemptsCount and surface in the
UI instead of retrying invisibly forever. Also review nits:
hoisted server local, documented reserved _acmeuserkey prefix.
@NiccoMlt
NiccoMlt force-pushed the 536-acme-certificate-support-custom-acme-providers branch from 8d2198e to a696ea2 Compare July 23, 2026 13:27
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.

1 participant