pub struct TlsConfig {
pub min_version: TlsVersion,
pub validate_certificates: bool,
pub custom_ca_certs: Option<Vec<Vec<u8>>>,
pub allowed_ciphers: Option<Vec<String>>,
}Expand description
TLS/HTTPS configuration for secure transport connections.
Fields§
§min_version: TlsVersionMinimum TLS protocol version to accept.
validate_certificates: boolWhether to validate server certificates.
custom_ca_certs: Option<Vec<Vec<u8>>>Custom CA certificates to trust (PEM or DER format).
allowed_ciphers: Option<Vec<String>>Allowed TLS cipher suites (cipher suite names).
Implementations§
Source§impl TlsConfig
impl TlsConfig
Sourcepub const fn insecure() -> TlsConfig
pub const fn insecure() -> TlsConfig
Create an insecure TLS configuration that skips certificate validation.
Warning: This configuration is insecure and should ONLY be used in testing.
Sourcepub const fn is_insecure(&self) -> bool
pub const fn is_insecure(&self) -> bool
Check if this configuration is insecure (skips certificate validation).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TlsConfig
impl<'de> Deserialize<'de> for TlsConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TlsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TlsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TlsConfig
impl Serialize for TlsConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for TlsConfig
impl StructuralPartialEq for TlsConfig
Auto Trait Implementations§
impl Freeze for TlsConfig
impl RefUnwindSafe for TlsConfig
impl Send for TlsConfig
impl Sync for TlsConfig
impl Unpin for TlsConfig
impl UnsafeUnpin for TlsConfig
impl UnwindSafe for TlsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.