Repository navigation
Add automatic certificates through rustls-acme - #205
Merged
Merged
Conversation
Add the optional `tls-rustls-acme` feature and the `acme` module. `Acceptor` implements the accept hook with rustls-acme's resolver, handles TLS-ALPN-01 validation connections, and serves acquired certificates with h2 and http/1.1 ALPN. The application polls the `AcmeState` for renewal. This avoids rustls-acme's own axum adapter, which pins axum-server 0.8. Includes an example, tests with self-signed configs, and CI wiring.
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.
Adds an optional
tls-rustls-acmefeature and anacmemodule that obtains and renews certificates automatically throughrustls-acme. This covers the request in #113 for Caddy-like automatic HTTPS.The renewal stream must be polled. The application owns the
AcmeStateand polls it, as shown above; without the loop no certificate is acquired or renewed. This keeps the library free of hidden background tasks.TLS-ALPN-01 only, so the server must be reachable on port 443. HTTP-01 needs a separate :80 listener and rustls-acme's
towerfeature; it can be a follow-up.ZeroSSLis not supported: it requires external account binding, whichrustls-acmedoes not implement. Let's Encrypt and other non-EAB ACME CAs work.rustls-acme's own
axumfeature is not used: it pinsaxum-server 0.8, which cannot compile against 0.9.The feature enables rustls-acme's
aws-lc-rs,tls12, andwebpki-rootsfeatures, and implies ourtls-rustls.Added
tls-rustls-acmeto the clippy, build, test, and minimal-versions matrices.The minimal-versions job needed a
num-bigintlower bound: 0.4.0 does not compile on current rustc (div_ceilnow resolves to the inherent method). Pinned inminimal-versions/Cargo.tomllike the existingtower-layerandaws-lc-rspins.