From 20cc8d534b25de617b5688aa18268b6dd55d092d Mon Sep 17 00:00:00 2001 From: M1 Date: Mon, 16 Mar 2026 12:39:29 +0400 Subject: [PATCH] fix: rustls crypto provider + Arc import for cert expiry --- apps/monitor/Cargo.toml | 2 +- apps/monitor/src/main.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/monitor/Cargo.toml b/apps/monitor/Cargo.toml index 583c7fa..5bb15bc 100644 --- a/apps/monitor/Cargo.toml +++ b/apps/monitor/Cargo.toml @@ -14,7 +14,7 @@ regex = "1" anyhow = "1" tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -rustls = "0.23" +rustls = { version = "0.23", features = ["ring"] } rustls-native-certs = "0.8" webpki-roots = "0.26" x509-parser = "0.16" diff --git a/apps/monitor/src/main.rs b/apps/monitor/src/main.rs index e9224b3..0f621fb 100644 --- a/apps/monitor/src/main.rs +++ b/apps/monitor/src/main.rs @@ -4,11 +4,17 @@ mod types; use anyhow::Result; use std::env; +use rustls; use tokio::time::{sleep, Duration}; use tracing::{error, info}; #[tokio::main] async fn main() -> Result<()> { + // Install default rustls crypto provider (required for cert expiry checks) + rustls::crypto::ring::default_provider() + .install_default() + .ok(); // ok() — ignore error if already installed + tracing_subscriber::fmt() .with_env_filter(env::var("RUST_LOG").unwrap_or_else(|_| "info".into())) .init();