diff --git a/bin/core/src/main.rs b/bin/core/src/main.rs index 6f4430715..0afb48636 100644 --- a/bin/core/src/main.rs +++ b/bin/core/src/main.rs @@ -40,12 +40,6 @@ async fn app() -> anyhow::Result<()> { dotenvy::dotenv().ok(); let config = core_config(); logger::init(&config.logging)?; - if let Err(e) = - rustls::crypto::aws_lc_rs::default_provider().install_default() - { - error!("Failed to install default crypto provider | {e:?}"); - std::process::exit(1); - }; info!("Komodo Core version: v{}", env!("CARGO_PKG_VERSION")); // Init public key to crash on failure @@ -61,6 +55,10 @@ async fn app() -> anyhow::Result<()> { (false, false) => info!("{:?}", config.sanitized()), } + rustls::crypto::aws_lc_rs::default_provider() + .install_default() + .expect("Failed to install default crypto provider"); + // Init jwt client to crash on failure state::jwt_client(); tokio::join!( diff --git a/bin/periphery/src/main.rs b/bin/periphery/src/main.rs index 65dc6ed05..7f47f880f 100644 --- a/bin/periphery/src/main.rs +++ b/bin/periphery/src/main.rs @@ -28,7 +28,10 @@ async fn app() -> anyhow::Result<()> { info!("{:?}", config.sanitized()); } - install_crypto_provider(); + rustls::crypto::aws_lc_rs::default_provider() + .install_default() + .expect("Failed to install default crypto provider"); + stats::spawn_polling_thread(); docker::stats::spawn_polling_thread(); @@ -90,12 +93,3 @@ async fn main() -> anyhow::Result<()> { Ok(()) } - -fn install_crypto_provider() { - if let Err(e) = - rustls::crypto::aws_lc_rs::default_provider().install_default() - { - error!("Failed to install default crypto provider | {e:?}"); - std::process::exit(1); - }; -}