Fix certificate verifier

This commit is contained in:
Pascal Engélibert 2026-02-09 11:34:39 +01:00
commit 9e98cb5f39
3 changed files with 394 additions and 142 deletions

526
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -9,6 +9,7 @@ argp = "0.4.0"
env_logger = "0.11.8" env_logger = "0.11.8"
futures-util = "0.3.31" futures-util = "0.3.31"
log = "0.4.28" log = "0.4.28"
rustls-platform-verifier = "0.6.2"
sslrelay = { path = "../sslrelay", optional = true } sslrelay = { path = "../sslrelay", optional = true }
static_cell = "2.1.1" static_cell = "2.1.1"
tokio = { version = "1.48.0", features = ["io-util", "macros", "net", "rt", "rt-multi-thread", "sync", "time"]} tokio = { version = "1.48.0", features = ["io-util", "macros", "net", "rt", "rt-multi-thread", "sync", "time"]}
@ -40,4 +41,8 @@ ring = ["tokio-rustls/ring"]
symcrypt = ["rustls-symcrypt"] symcrypt = ["rustls-symcrypt"]
[profile.release] [profile.release]
#lto = "fat" lto = "fat"
[patch.crates-io]
rustls = { path = "../rustls/rustls" }
rustls-platform-verifier = { path = "../rustls-platform-verifier/rustls-platform-verifier"}

View file

@ -3,6 +3,7 @@ use crate::{
util::ResponseStreamer, util::ResponseStreamer,
}; };
use rustls_platform_verifier::BuilderVerifierExt;
use std::{ use std::{
collections::HashSet, collections::HashSet,
net::ToSocketAddrs, net::ToSocketAddrs,
@ -124,8 +125,10 @@ pub async fn play(
if use_tls { if use_tls {
let mut config = tokio_rustls::rustls::ClientConfig::builder() let mut config = tokio_rustls::rustls::ClientConfig::builder()
.dangerous() //.dangerous()
.with_custom_certificate_verifier(Arc::new(DummyCertVerifier)) //.with_custom_certificate_verifier(Arc::new(DummyCertVerifier))
.with_platform_verifier()
.unwrap()
.with_no_client_auth(); .with_no_client_auth();
let mut enable_early_data = false; let mut enable_early_data = false;
for (var, val) in std::env::vars() { for (var, val) in std::env::vars() {