fix: rustls crypto provider + Arc import for cert expiry

This commit is contained in:
M1 2026-03-16 12:39:29 +04:00
parent 500132ba05
commit 20cc8d534b
2 changed files with 7 additions and 1 deletions

View File

@ -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"

View File

@ -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();