pub struct TlsConfigBuilder { /* private fields */ }Expand description
TLS configuration builder.
Implementations§
Source§impl TlsConfigBuilder
impl TlsConfigBuilder
Sourcepub fn server_name(self, name: String) -> Self
pub fn server_name(self, name: String) -> Self
Set the server name for SNI.
Sourcepub fn client_cert_and_key(self, cert: Vec<u8>, key: Vec<u8>) -> Self
pub fn client_cert_and_key(self, cert: Vec<u8>, key: Vec<u8>) -> Self
Set the client certificate and key (PEM format).
Sourcepub fn server_cert_and_key(self, cert: Vec<u8>, key: Vec<u8>) -> Self
pub fn server_cert_and_key(self, cert: Vec<u8>, key: Vec<u8>) -> Self
Set the server certificate and key (PEM format).
Sourcepub fn verify_peer(self, verify: bool) -> Self
pub fn verify_peer(self, verify: bool) -> Self
Set whether to verify the peer certificate.
Sourcepub fn build_client(self) -> Result<Arc<ClientConfig>>
pub fn build_client(self) -> Result<Arc<ClientConfig>>
Build a client configuration.
Sourcepub fn build_server(self) -> Result<Arc<ServerConfig>>
pub fn build_server(self) -> Result<Arc<ServerConfig>>
Build a server configuration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TlsConfigBuilder
impl RefUnwindSafe for TlsConfigBuilder
impl Send for TlsConfigBuilder
impl Sync for TlsConfigBuilder
impl Unpin for TlsConfigBuilder
impl UnsafeUnpin for TlsConfigBuilder
impl UnwindSafe for TlsConfigBuilder
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more