fix(server): re-enable ACME certificate acquisition - #28
Merged
Merged
Conversation
The ACME path was bypassed because rustls-acme 0.15.1 failed to parse
Let's Encrypt challenge JSON ("missing field token"). That was fixed
upstream in 0.15.2 (challenge deserialization for token-less challenge
types), and the lockfile already carries 0.15.4, so restore the TLS
source priority: explicit cert/key files > ACME > self-signed fallback.
The standalone health-check listener now starts only in non-ACME modes;
configure_acme's Axum server already serves the HTTP-01 challenge route
and a "/" health check on acme_bind_port, and both binding the same
port would fail.
Also select the Let's Encrypt production directory explicitly when no
custom directory URL is configured — rustls-acme's builder defaults to
staging, whose certificates clients don't trust — and drop the staging
pin from fly.toml accordingly.
Verified end-to-end against Pebble (test_acme_certificate_acquisition_
with_pebble): certificate acquired in ~1.2s.
Signed-off-by: Jonathon Klobucar <jonathon.klobucar@gmail.com>
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.
What this changes
Re-enables automated Let's Encrypt (ACME) certificate acquisition in the server,
restoring the intended TLS source priority: explicit cert/key files → ACME →
self-signed fallback. Also makes the Let's Encrypt production directory the
explicit default when no custom directory URL is configured, and unpins the
staging URL from
fly.toml.Why
The ACME path was hard-bypassed because rustls-acme 0.15.1 failed to parse
Let's Encrypt's challenge JSON (
missing field token), leaving every deploymenton a self-signed cert. Upstream fixed the deserialization for token-less
challenge types in 0.15.2, and our lockfile already carries 0.15.4, so the
bypass is no longer needed (the
Cargo.tomlrequirement is raised to match).Two footguns fixed along the way:
configure_acmealready serves the HTTP-01 challenge route plus acheck on
acme_bind_port, so both would race to bind the same port.whose certificates clients don't trust. An unset
AURA_ACME_DIRECTORY_URLnow explicitly selects production instead of silently issuing stag
How tested
(
test_acme_certificate_acquisition_with_pebble): certificate acquired in~1.2s. Pebble runs from
ghcr.io/letsencrypt/pebble(the Docker Hub image isno longer pullable).
cargo test --workspace,cargo fmt --all -- --check, andcargo clippy --workspace --all-targets -- -D warningsall pass.#[serde(default)]token fix confirmed present in the published crate source.
Notes for the reviewer
aura-dave) andare untouched; only the TLS certificate source changes.
AURA_ACME_DOMAIN/AURA_ACME_CONTACTvia
fly secrets set; the placeholders infly.tomlare unchangeEncrypt production — mind the rate limits if redeploying repeatedly.
Checklist
git commit -s) per the DCOcargo fmt --allcleancargo clippy --workspace --all-targets -- -D warningscleancargo test --workspacepassesdocs/protocol.md— n/a, no protocol changesdocs/MLS_SECURIotocol_deviations.md— n/a, TLS cert sourcing only