pub struct TlsServerConfig { /* private fields */ }Expand description
TLS server configuration
Implementations§
Source§impl TlsServerConfig
impl TlsServerConfig
Sourcepub fn new<P: AsRef<Path>>(cert_path: P, key_path: P) -> Self
pub fn new<P: AsRef<Path>>(cert_path: P, key_path: P) -> Self
Create a new TLS server configuration
Sourcepub fn with_tls_versions(self, versions: Vec<TlsVersion>) -> Self
pub fn with_tls_versions(self, versions: Vec<TlsVersion>) -> Self
Set allowed TLS protocol versions
Sourcepub fn with_cipher_suites(
self,
cipher_suites: Vec<SupportedCipherSuite>,
) -> Self
pub fn with_cipher_suites( self, cipher_suites: Vec<SupportedCipherSuite>, ) -> Self
Set allowed cipher suites
Sourcepub fn with_client_auth<S: Into<String>>(self, client_ca_path: S) -> Self
pub fn with_client_auth<S: Into<String>>(self, client_ca_path: S) -> Self
Enable mutual TLS authentication by providing a CA certificate path
Sourcepub fn require_client_auth(self, required: bool) -> Self
pub fn require_client_auth(self, required: bool) -> Self
Set whether client authentication is required (true) or optional (false)
Sourcepub fn generate_self_signed<P: AsRef<Path>>(
cert_path: P,
key_path: P,
) -> Result<Self>
pub fn generate_self_signed<P: AsRef<Path>>( cert_path: P, key_path: P, ) -> Result<Self>
Generate a self-signed certificate for development/testing purposes
Sourcepub fn load_server_config(&self) -> Result<ServerConfig>
pub fn load_server_config(&self) -> Result<ServerConfig>
Load the TLS configuration from files
Auto Trait Implementations§
impl Freeze for TlsServerConfig
impl !RefUnwindSafe for TlsServerConfig
impl Send for TlsServerConfig
impl Sync for TlsServerConfig
impl Unpin for TlsServerConfig
impl !UnwindSafe for TlsServerConfig
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