From 065b0c58471394343a9154fdbb32c4fb582491dc Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 7 Sep 2024 23:48:45 +0200 Subject: [PATCH] feat: always install Signed-off-by: kjuulh --- crates/flux-releaser/Cargo.toml | 2 +- crates/flux-releaser/src/app/infra/grpc.rs | 8 ++++++++ crates/flux-releaser/src/lib.rs | 4 ---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crates/flux-releaser/Cargo.toml b/crates/flux-releaser/Cargo.toml index 40ab605..0c2d493 100644 --- a/crates/flux-releaser/Cargo.toml +++ b/crates/flux-releaser/Cargo.toml @@ -32,7 +32,7 @@ sqlx = { version = "0.7.3", features = [ ] } chrono = "0.4.34" git2 = "0.18.3" -rustls = { version = "0.23.12", features = ["ring"] } +rustls = { version = "0.23.12" } [build-dependencies] tonic-build = "0.12.0" diff --git a/crates/flux-releaser/src/app/infra/grpc.rs b/crates/flux-releaser/src/app/infra/grpc.rs index 606d5d8..7b9a17d 100644 --- a/crates/flux-releaser/src/app/infra/grpc.rs +++ b/crates/flux-releaser/src/app/infra/grpc.rs @@ -10,6 +10,14 @@ pub type FluxReleaserGrpcClient = Arc>>; pub async fn new_client(registry: impl Into) -> anyhow::Result { let registry: String = registry.into(); + static INIT: std::sync::Once = std::sync::Once::new(); + + INIT.call_once(|| { + rustls::crypto::aws_lc_rs::default_provider() + .install_default() + .unwrap(); + }); + let channel = if registry.starts_with("https") { let tls = ClientTlsConfig::new(); diff --git a/crates/flux-releaser/src/lib.rs b/crates/flux-releaser/src/lib.rs index 1c4d5d0..c70334f 100644 --- a/crates/flux-releaser/src/lib.rs +++ b/crates/flux-releaser/src/lib.rs @@ -9,10 +9,6 @@ pub mod services; pub async fn run() -> anyhow::Result<()> { dotenv::dotenv().ok(); - rustls::crypto::ring::default_provider() - .install_default() - .expect("Failed to install rustls crypto provider"); - Command::run().await?; Ok(())