From ecf411cbc8841e4f306fd8bdc9951b04baf189c8 Mon Sep 17 00:00:00 2001 From: Aaron Weiss Date: Mon, 18 Mar 2024 16:09:03 -0700 Subject: [PATCH] bring dangerously_accept_invalid_certs in line with the other config options --- src/client/data/config.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/data/config.rs b/src/client/data/config.rs index efaed3a..9f65b2b 100644 --- a/src/client/data/config.rs +++ b/src/client/data/config.rs @@ -144,6 +144,8 @@ pub struct Config { /// You should think very carefully before using this method. If invalid hostnames are trusted, *any* valid /// certificate for *any* site will be trusted for use. This introduces significant vulnerabilities, and should /// only be used as a last resort. + #[cfg(any(feature = "tls-native", feature = "tls-rust"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] pub dangerously_accept_invalid_certs: Option, /// The encoding type used for this connection. /// This is typically UTF-8, but could be something else. @@ -517,6 +519,7 @@ impl Config { /// Gets whether or not to dangerously accept invalid certificates. /// This defaults to `false` when not specified. + #[cfg(any(feature = "tls-native", feature = "tls-rust"))] pub fn dangerously_accept_invalid_certs(&self) -> bool { self.dangerously_accept_invalid_certs .as_ref()