pub struct TlsServerConfig { /* private fields */ }Expand description
Server identity and HTTP/2 ALPN policy for synchronous TLS servers.
Implementations§
Source§impl TlsServerConfig
impl TlsServerConfig
Sourcepub fn new(
cert_chain: Vec<CertificateDer<'static>>,
private_key: PrivateKeyDer<'static>,
) -> Result<Self>
pub fn new( cert_chain: Vec<CertificateDer<'static>>, private_key: PrivateKeyDer<'static>, ) -> Result<Self>
Builds a TLS 1.3 server from a DER certificate chain and private key.
Clients authenticate the server; client certificates are not required.
§Errors
Returns an error for an unsupported provider, invalid identity, or a certificate and private key that do not match.
Sourcepub fn from_rustls(config: ServerConfig) -> Self
pub fn from_rustls(config: ServerConfig) -> Self
Uses a caller’s certificate policy, requiring HTTP/2 and disabling 0-RTT.
The caller remains responsible for the supplied configuration’s client authentication, protocol versions, and cryptographic provider.
Sourcepub fn get_ref(&self) -> &ServerConfig
pub fn get_ref(&self) -> &ServerConfig
Returns the immutable rustls configuration.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TlsServerConfig
impl !UnwindSafe for TlsServerConfig
impl Freeze for TlsServerConfig
impl Send for TlsServerConfig
impl Sync for TlsServerConfig
impl Unpin for TlsServerConfig
impl UnsafeUnpin 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