From 7c7414cf93a472a83af921ee2e81f4f290c9e1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Eng=C3=A9libert?= Date: Tue, 3 Mar 2026 09:38:31 +0100 Subject: [PATCH] fix skip verif --- Cargo.toml | 2 +- src/main.rs | 2 +- src/server.rs | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8e0e384..a801b9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ log = "0.4.28" rustls-platform-verifier = "0.6.2" sslrelay = { path = "../sslrelay", optional = true } static_cell = "2.1.1" -tokio = { version = "1.49.0", features = ["io-util", "macros", "net", "rt", "rt-multi-thread", "sync", "time"]} +tokio = { version = "1.49.0", features = ["io-util", "macros", "net", "rt-multi-thread", "sync", "time"]} tokio-rustls = "0.26.4" tokio-util = { version = "0.7.18", features = ["codec"] } x509-parser = "0.18.1" diff --git a/src/main.rs b/src/main.rs index 58830a8..b22ef53 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,7 +65,7 @@ struct OptClient { #[argp(option, short = 'c')] certs: Option, /// Do not verify certificates - #[argp(option, short = 's')] + #[argp(switch, short = 's')] skip_verif: bool, /// Print debug info #[argp(switch, short = 'd')] diff --git a/src/server.rs b/src/server.rs index 2fd6c7f..92c44a7 100644 --- a/src/server.rs +++ b/src/server.rs @@ -17,7 +17,7 @@ pub async fn play( use_tls: bool, cert_path: &str, listen_addr: (&str, u16), - _debug: bool, + debug: bool, ) { let mut response_map = HashMap::new(); for (conn_id, (_server_name, records)) in records.iter() { @@ -177,7 +177,9 @@ pub async fn play( if let Some((responses, last)) = response_map.get(&(conn_id, req_id)) { //dbg!(id); for (req_id, len) in responses { - //println!("[SRV] response for ({}): {} bytes", id, res.len()); + if debug { + println!("[SRV] response for ({req_id}): {len} bytes"); + } let mut data = dummy_bytes[0..*len as usize].to_vec(); data[0..4].copy_from_slice(&(*len as u32).to_be_bytes()); data[4..6].copy_from_slice(&(conn_id as u16).to_be_bytes());