Skip to content

Commit

Permalink
bring dangerously_accept_invalid_certs in line with the other config …
Browse files Browse the repository at this point in the history
…options
  • Loading branch information
aatxe committed Mar 18, 2024
1 parent f640e49 commit ecf411c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/client/data/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>,
/// The encoding type used for this connection.
/// This is typically UTF-8, but could be something else.
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit ecf411c

Please sign in to comment.