From 6bcfa56075eb075fc7f276956fbe992592d7ba00 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaury1093@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:39:14 +0100 Subject: [PATCH] Add rustls --- Cargo.lock | 2 ++ backend/Cargo.toml | 1 + backend/src/main.rs | 4 ++++ cli/Cargo.toml | 1 + cli/src/main.rs | 3 +++ 5 files changed, 11 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index cbec21df3..db32755d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -617,6 +617,7 @@ dependencies = [ "clap", "once_cell", "openssl", + "rustls 0.23.20", "serde", "serde_json", "tokio", @@ -2983,6 +2984,7 @@ dependencies = [ "lapin", "openssl", "reqwest", + "rustls 0.23.20", "sentry", "sentry-anyhow", "serde", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index c2eaa105d..b64bbea9e 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -43,6 +43,7 @@ tracing = "0.1.40" tracing-subscriber = "0.3.18" uuid = "1.10" warp = "0.3" +rustls = { version = "0.23", features = ["ring"] } [dev-dependencies] toml = "0.8" diff --git a/backend/src/main.rs b/backend/src/main.rs index e815cd62b..eaaa3e7b2 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -31,6 +31,10 @@ const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); async fn main() -> Result<(), anyhow::Error> { // Initialize logging. tracing_subscriber::fmt::init(); + rustls::crypto::ring::default_provider() + .install_default() + .expect("Failed to install rustls crypto provider"); + info!(target: LOG_TARGET, version=?CARGO_PKG_VERSION, "Running Reacher"); let mut config = load_config().await?; config.connect().await?; diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 33e1dcb14..93b30186a 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -18,6 +18,7 @@ check-if-email-exists = { path = "../core" } clap = { version = "3.2", features = ["derive", "env"] } once_cell = "1.19" openssl = { version = "0.10", features = ["vendored"] } +rustls = { version = "0.23", features = ["ring"] } serde = "1.0" serde_json = "1.0" tracing-subscriber = "0.3.18" diff --git a/cli/src/main.rs b/cli/src/main.rs index fa90df434..f3978b3cd 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -90,6 +90,9 @@ pub(crate) static CONF: Lazy = Lazy::new(Cli::parse); #[tokio::main] async fn main() -> Result<(), anyhow::Error> { tracing_subscriber::fmt::init(); + rustls::crypto::ring::default_provider() + .install_default() + .expect("Failed to install rustls crypto provider"); let to_email = &CONF.to_email;