pub struct TlsConfig { /* private fields */ }Expand description
Strict server-certificate validation with optional client authentication.
Implementations§
Source§impl TlsConfig
impl TlsConfig
Sourcepub fn with_root_certificates(
self,
pem: impl AsRef<[u8]>,
mode: RootCertificateMode,
) -> Result<Self, NetError>
pub fn with_root_certificates( self, pem: impl AsRef<[u8]>, mode: RootCertificateMode, ) -> Result<Self, NetError>
Replaces the custom CA bundle and selects its trust mode. Accepts one to 128 PEM certificates with a total size of at most 1 MiB; malformed, mismatched, or trailing non-whitespace blocks are rejected.
Sourcepub fn with_client_identity(self, identity: ClientIdentity) -> Self
pub fn with_client_identity(self, identity: ClientIdentity) -> Self
Configures a client certificate identity.
Sourcepub fn root_mode(&self) -> RootCertificateMode
pub fn root_mode(&self) -> RootCertificateMode
Returns how custom roots are combined with built-in roots.
Sourcepub fn custom_root_count(&self) -> usize
pub fn custom_root_count(&self) -> usize
Returns the number of custom roots, excluding built-in WebPKI roots.
Sourcepub fn client_identity(&self) -> Option<&ClientIdentity>
pub fn client_identity(&self) -> Option<&ClientIdentity>
Returns the configured client identity, if any.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TlsConfig
impl !UnwindSafe for TlsConfig
impl Freeze for TlsConfig
impl Send for TlsConfig
impl Sync for TlsConfig
impl Unpin for TlsConfig
impl UnsafeUnpin 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