Rename all crates, CLI commands, constants, type names, doc comments, and documentation from wraith to alknet. Includes wire-protocol changes: ALPN wraith-ssh -> alknet-ssh, reserved destination prefix wraith- -> alknet-, SSH auth username wraith -> alknet.
3.3 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | |
|---|---|---|---|---|---|---|---|---|
| transport/acme-cert-provisioning | Implement ACME Lets Encrypt certificate provisioning (feature-gated acme) | pending |
|
moderate | high | component | implementation |
Description
Implement automatic TLS certificate provisioning via ACME (Let's Encrypt). Two modes per ADR-008:
- Domain-based ACME (
--acme-domain): Standard flow with HTTP-01 or TLS-ALPN-01 challenges. Domain-bound, auto-renewing. - IP-based ACME: Short-lived certs via TLS-ALPN-01 on port 443. No domain needed.
Uses rustls-acme (pure Rust) to avoid external certbot dependency. Feature-gated behind acme (implies tls).
This integrates with TlsAcceptor by providing ACME-resolved certificates instead of manual cert/key files.
Acceptance Criteria
crates/alknet-core/src/transport/acme.rs(behind#[cfg(feature = "acme")])- Feature
acmeimpliestlsin Cargo.toml AcmeCertProviderstruct accepts: domain (domain-based) or IP mode flag- Domain-based mode: uses
rustls-acmewith HTTP-01/TLS-ALPN-01 challenge responder - IP-based mode: uses
rustls-acmewith TLS-ALPN-01 on port 443 AcmeCertProviderproduces arustls::ServerConfigthatTlsAcceptorcan use- Certificate auto-renewal handled by
rustls-acmebackground task TlsAcceptorupdated to accept either manual certs OR anAcmeCertProvider- Integration with
TlsAcceptor::bind_acme()or similar constructor - Unit tests for ACME config construction (challenge responder setup)
- Integration test: ACME cert provisioning with Let's Encrypt staging (marked
#[ignore]for CI)
References
- docs/architecture/server.md — TLS certificate provisioning modes
- docs/architecture/decisions/008-acme-lets-encrypt.md — ACME design, rustls-acme choice
- docs/architecture/transport.md — feature flags, TLS transport constraints
Notes
AcmeCertProvideris the main entry point. It createsAcmeStateandResolvesServerCertAcmefromrustls-acme.- The
ResolvesServerCertAcmeresolver is shared between theAcmeStatebackground task and theServerConfig, so cert updates propagate automatically. AcmeTlsAcceptor::bind_acme()creates a TLS acceptor that uses ACME-provisioned certs and spawns a background tokio task for auto-renewal.TlsAcceptor::bind_acme()also added for users who want to use ACME with the standardTlsAcceptortype directly.- The
AcmeConfigstub intls.rsis retained for backward compat with existingTlsAcceptor::bind(). acmefeature impliestlsand addsrustls-acme+futuresdependencies.- TLS-ALPN-01 challenge handling works via the
acme-tls/1ALPN protocol registered inServerConfig— the resolver dispatches challenge vs regular certs automatically.
Summary
Implemented ACME/Let's Encrypt certificate provisioning (ADR-008) behind the acme feature flag. AcmeCertProvider supports domain-based and IP-based modes using rustls-acme. AcmeTlsAcceptor::bind_acme() and TlsAcceptor::bind_acme() provide ACME-integrated TLS acceptance with automatic certificate renewal via a background tokio task. Unit tests cover config construction, builder patterns, and server config generation. Integration test for LE staging is marked #[ignore].