pub struct TlsServerConfig {
pub cert_path: String,
pub key_path: String,
pub alpn_protocols: Vec<Vec<u8>>,
pub min_version: TlsVersion,
}Expand description
TLS server configuration builder
Fields§
§cert_path: StringPath to certificate file (PEM format)
key_path: StringPath to private key file (PEM format)
alpn_protocols: Vec<Vec<u8>>ALPN protocols to advertise
min_version: TlsVersionMinimum TLS version
Implementations§
Source§impl TlsServerConfig
impl TlsServerConfig
Sourcepub fn new(cert_path: impl Into<String>, key_path: impl Into<String>) -> Self
pub fn new(cert_path: impl Into<String>, key_path: impl Into<String>) -> Self
Create a new TLS server configuration
Sourcepub fn with_alpn_protocols(self, protocols: Vec<Vec<u8>>) -> Self
pub fn with_alpn_protocols(self, protocols: Vec<Vec<u8>>) -> Self
Set ALPN protocols
Sourcepub fn with_min_version(self, version: TlsVersion) -> Self
pub fn with_min_version(self, version: TlsVersion) -> Self
Set minimum TLS version
Sourcepub fn from_config(config: &TlsConfig) -> Self
pub fn from_config(config: &TlsConfig) -> Self
Create from a TlsConfig
Trait Implementations§
Source§impl Clone for TlsServerConfig
impl Clone for TlsServerConfig
Source§fn clone(&self) -> TlsServerConfig
fn clone(&self) -> TlsServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TlsServerConfig
impl RefUnwindSafe for TlsServerConfig
impl Send for TlsServerConfig
impl Sync for TlsServerConfig
impl Unpin for TlsServerConfig
impl UnsafeUnpin for TlsServerConfig
impl UnwindSafe for TlsServerConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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