Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions crates/aisix-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ struct Cli {

#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Install the process-level rustls CryptoProvider before anything
// else touches TLS. rustls 0.23 dropped implicit provider selection
// and panics at first use when both `aws-lc-rs` and `ring` features
// are reachable (or neither is) — which is the case here through
// transitive deps on reqwest + etcd-client + tokio-rustls.
//
// We pick aws-lc-rs because it's the upstream default as of
// rustls 0.23, FIPS-capable, and what every compiled-in crate
// already depends on transitively. Falls back to ring only if
// the process somehow has a provider installed already (idempotent).
Comment on lines +56 to +57

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says this "falls back to ring" if a provider is already installed, but the code doesn't install ring or perform any fallback logic; it simply keeps whatever default provider was installed first. Consider rewording to avoid implying ring is involved (e.g., "if another provider is already installed, keep it").

Suggested change
// already depends on transitively. Falls back to ring only if
// the process somehow has a provider installed already (idempotent).
// already depends on transitively. If another provider is already
// installed for the process, `install_default()` keeps it unchanged.

Copilot uses AI. Check for mistakes.
let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();

let cli = Cli::parse();

// Steps 1-2: config.
Expand Down
Loading