fix: rustls crypto provider + Arc import for cert expiry
This commit is contained in:
parent
500132ba05
commit
20cc8d534b
|
|
@ -14,7 +14,7 @@ regex = "1"
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
rustls = "0.23"
|
rustls = { version = "0.23", features = ["ring"] }
|
||||||
rustls-native-certs = "0.8"
|
rustls-native-certs = "0.8"
|
||||||
webpki-roots = "0.26"
|
webpki-roots = "0.26"
|
||||||
x509-parser = "0.16"
|
x509-parser = "0.16"
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,17 @@ mod types;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
use rustls;
|
||||||
use tokio::time::{sleep, Duration};
|
use tokio::time::{sleep, Duration};
|
||||||
use tracing::{error, info};
|
use tracing::{error, info};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<()> {
|
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()
|
tracing_subscriber::fmt()
|
||||||
.with_env_filter(env::var("RUST_LOG").unwrap_or_else(|_| "info".into()))
|
.with_env_filter(env::var("RUST_LOG").unwrap_or_else(|_| "info".into()))
|
||||||
.init();
|
.init();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue