pub struct ServerTlsConfig {
pub cert: PemSource,
pub key: PemSource,
pub client_ca: Option<PemSource>,
pub alpn: Vec<Vec<u8>>,
}Expand description
Server-side TLS configuration.
Construct via ServerTlsConfig::builder.
Fields§
§cert: PemSourceServer certificate chain (leaf first).
key: PemSourceServer private key (PKCS#8, PKCS#1, or SEC1).
client_ca: Option<PemSource>Trusted CA bundle for verifying client certificates (mTLS).
None = standard TLS (no client cert required).
alpn: Vec<Vec<u8>>ALPN protocol list, in preference order (e.g. [b"h2"] for gRPC).
Empty = no ALPN negotiation requested.
Implementations§
Source§impl ServerTlsConfig
impl ServerTlsConfig
Sourcepub fn builder() -> ServerTlsConfigBuilder
pub fn builder() -> ServerTlsConfigBuilder
Start a new builder.
Sourcepub fn into_rustls_config(self) -> Result<ServerConfig, TlsError>
pub fn into_rustls_config(self) -> Result<ServerConfig, TlsError>
Build a rustls::ServerConfig from this configuration.
Reads PEM sources from disk (or memory), parses certs and key, optionally constructs a WebPkiClientVerifier for mTLS, and applies ALPN settings.
All I/O and parse errors surface here.
Auto-installs the ring CryptoProvider if no provider is set process-wide.
Trait Implementations§
Source§impl Clone for ServerTlsConfig
impl Clone for ServerTlsConfig
Source§fn clone(&self) -> ServerTlsConfig
fn clone(&self) -> ServerTlsConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ServerTlsConfig
impl RefUnwindSafe for ServerTlsConfig
impl Send for ServerTlsConfig
impl Sync for ServerTlsConfig
impl Unpin for ServerTlsConfig
impl UnsafeUnpin for ServerTlsConfig
impl UnwindSafe for ServerTlsConfig
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