fix: install rustls ring CryptoProvider before TLS clients init#3
Merged
Conversation
With both `kube` and `redis` features pulling rustls 0.23 alongside
`aws-lc-rs` and `ring` transitively, rustls refuses to auto-pick a
process-level CryptoProvider and panics on first TLS use. This crashed
the Kubernetes Ingress watcher's apiserver connection on startup:
Could not automatically determine the process-level CryptoProvider
from Rustls crate features.
Install `rustls::crypto::ring::default_provider()` at the top of `main()`
before any TLS-using component (kube-rs, reqwest, server entrypoints) is
constructed. `ring` is already what `proxy/tls.rs` uses for server-side
TLS, so this matches existing intent.
Bumps a3s-gateway 1.0.1 → 1.0.2 and Helm chart 1.0.0 → 1.0.2.
Contributor
Author
CI status noteThe MSRV Check job is failing on a pre-existing This failure is not introduced by this PR — every commit on Other PR jobs are healthy:
Notably, The acl warning belongs in a separate PR against |
ZhiXiao-Lin
added a commit
to A3S-Lab/a3s
that referenced
this pull request
May 16, 2026
Picks up A3S-Lab/Gateway#3: install rustls::crypto::ring as the process-level CryptoProvider before any TLS-using component constructs. Resolves the `tokio-rt-worker` panic that crashed v1.0.1 pods on every cluster as soon as the kube-rs Ingress watcher opened its first TLS connection to the apiserver. 3fdad48 → bf4029a Co-authored-by: Roy Lin <roylin@a3s.dev>
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.
Summary
Fixes the
tokio-rt-workerpanic on startup that crashed pods running with thekubeandredisfeatures enabled (i.e. the v1.0.1 OCI image used as a Kubernetes Ingress Controller). This was deterministically reproducible against any cluster — every pod hit it as soon as the Ingress watcher opened its first TLS connection to the apiserver.Root cause
rustls 0.23requires an explicit process-levelCryptoProviderwhen bothaws-lc-rsandringare present in the dep graph. With featureskube+redisenabled, both backends get pulled in transitively, and rustls refuses to auto-pick:Logs from the failing pod show the panic landing right after
Kubernetes Ingress watcher started— exactly when kube-rs constructs its first rustls client to talk to apiserver.Fix
Install
rustls::crypto::ring::default_provider()at the top ofmain(), before any TLS-using component (kube-rs, reqwest, server entrypoints) is constructed.ringis already whatproxy/tls.rs:151uses for server-side TLS, so this matches existing intent.Verification
cargo build --features kube,redis --release✅cargo test --features kube,redis --lib→ 1027 passed, 0 failed ✅10.12.111.133had the v1.0.1 image in CrashLoopBackOff (7 restarts in 13 min); panic stack matches above.Versioning
Cargo.toml: 1.0.1 → 1.0.2deploy/helm/a3s-gateway/Chart.yaml: 1.0.0 → 1.0.2 (was lagging)CHANGELOG.md: 1.0.2 entry added