From e44cbc1e264034c8b744d22f7864b072e8787f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Eng=C3=A9libert?= Date: Mon, 24 Aug 2026 12:29:03 +0200 Subject: [PATCH] Fix record feature optional --- src/record.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/record.rs b/src/record.rs index 823c877..5ba5317 100644 --- a/src/record.rs +++ b/src/record.rs @@ -1,7 +1,9 @@ use crate::util::SigAlg; +#[cfg(feature = "record")] use dashmap::DashMap; use log::error; +#[cfg(feature = "record")] use openssl::{pkey::PKey, x509::X509}; use std::{ collections::{BTreeMap, HashMap, btree_map}, @@ -37,6 +39,7 @@ static TEST_RECORD: &[(u64, &str, Direction, &[u8])] = //(1, "upload.wikimedia.org", Direction::ServerToClient, b"0\r\n\r\n"), ]; +#[cfg(feature = "record")] #[derive(Debug)] pub struct LyingCertificateRegistry { by_name: DashMap, @@ -44,6 +47,7 @@ pub struct LyingCertificateRegistry { certs_dir: PathBuf, } +#[cfg(feature = "record")] impl LyingCertificateRegistry { pub fn new(ca_dir: &str, certs_dir: &str) -> Self { Self { @@ -366,6 +370,7 @@ impl LyingCertificateRegistry { } } +#[cfg(feature = "record")] pub static CERTIFICATES: OnceLock = OnceLock::new(); fn write_record( @@ -475,6 +480,7 @@ impl sslrelay::HandlerCallbacks for Handler { } } +#[cfg(feature = "record")] fn servername_callback( ssl: &mut openssl::ssl::SslRef, _alert: &mut openssl::ssl::SslAlert,