From 4f9b913f15ad607f25a7c055e432d93f37f9ea05 Mon Sep 17 00:00:00 2001 From: Echo Date: Tue, 28 Apr 2026 23:34:46 +0000 Subject: [PATCH] fix: add rustls ring feature and CryptoProvider for TLS support --- Cargo.lock | 1 + Cargo.toml | 3 +-- crates/pm-web/Cargo.toml | 1 + crates/pm-web/src/main.rs | 5 +++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c359975..b3ccc1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2253,6 +2253,7 @@ dependencies = [ "pm-reports", "rand 0.8.6", "reqwest", + "rustls", "serde", "serde_json", "sha2", diff --git a/Cargo.toml b/Cargo.toml index dc4025c..79cda0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,8 +53,7 @@ chrono = { version = "0.4", features = ["serde"] } # HTTP client reqwest = { version = "0.12", features = ["rustls-tls", "json"] } -# TLS -rustls = { version = "0.23" } +rustls = { version = "0.23", features = ["ring"] } tokio-rustls = { version = "0.26" } rustls-pemfile = { version = "2" } diff --git a/crates/pm-web/Cargo.toml b/crates/pm-web/Cargo.toml index f575fd6..3c57ad8 100644 --- a/crates/pm-web/Cargo.toml +++ b/crates/pm-web/Cargo.toml @@ -17,6 +17,7 @@ pm-reports = { path = "../pm-reports" } tokio = { workspace = true } axum = { workspace = true } axum-server = { workspace = true } +rustls = { workspace = true } axum-extra = { workspace = true } tower = { workspace = true } tower-http = { workspace = true } diff --git a/crates/pm-web/src/main.rs b/crates/pm-web/src/main.rs index 71402ae..f3646a8 100644 --- a/crates/pm-web/src/main.rs +++ b/crates/pm-web/src/main.rs @@ -33,6 +33,11 @@ pub struct AppState { #[tokio::main] async fn main() -> anyhow::Result<()> { + // Install the default crypto provider for rustls (required since 0.23) + rustls::crypto::ring::default_provider() + .install_default() + .expect("Failed to install rustls crypto provider"); + let config_path = std::env::var("PATCH_MANAGER_CONFIG") .unwrap_or_else(|_| "/etc/patch-manager/config.toml".to_string());