pub struct ServerTlsConfigBuilder { /* private fields */ }Expand description
Incremental builder for ServerTlsConfig.
Implementations§
Source§impl ServerTlsConfigBuilder
impl ServerTlsConfigBuilder
Sourcepub fn with_alpn<I, S>(self, protocols: I) -> Self
pub fn with_alpn<I, S>(self, protocols: I) -> Self
Set the ALPN protocol list, in preference order.
Pass ["h2"] for gRPC-only, ["h2", "http/1.1"] for axum HTTP.
Default is empty (no ALPN negotiation).
Sourcepub fn cert_pem_file(self, path: impl Into<PathBuf>) -> Self
pub fn cert_pem_file(self, path: impl Into<PathBuf>) -> Self
Convenience: set the server cert chain from a file path.
Sourcepub fn cert_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
pub fn cert_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
Convenience: set the server cert chain from in-memory bytes.
Sourcepub fn key_pem_file(self, path: impl Into<PathBuf>) -> Self
pub fn key_pem_file(self, path: impl Into<PathBuf>) -> Self
Convenience: set the server private key from a file path.
Sourcepub fn key_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
pub fn key_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
Convenience: set the server private key from in-memory bytes.
Sourcepub fn require_client_ca_pem_file(self, path: impl Into<PathBuf>) -> Self
pub fn require_client_ca_pem_file(self, path: impl Into<PathBuf>) -> Self
Convenience: enable mTLS with a CA bundle from a file path.
Sourcepub fn require_client_ca_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
pub fn require_client_ca_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
Convenience: enable mTLS with a CA bundle from in-memory bytes.
Sourcepub fn require_client_ca(self, src: PemSource) -> Self
pub fn require_client_ca(self, src: PemSource) -> Self
Require client certificates signed by this CA bundle (turns on mTLS).
Sourcepub fn build(self) -> Result<ServerTlsConfig, TlsError>
pub fn build(self) -> Result<ServerTlsConfig, TlsError>
Build.
Trait Implementations§
Source§impl Clone for ServerTlsConfigBuilder
impl Clone for ServerTlsConfigBuilder
Source§fn clone(&self) -> ServerTlsConfigBuilder
fn clone(&self) -> ServerTlsConfigBuilder
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 moreSource§impl Debug for ServerTlsConfigBuilder
impl Debug for ServerTlsConfigBuilder
Source§impl Default for ServerTlsConfigBuilder
impl Default for ServerTlsConfigBuilder
Source§fn default() -> ServerTlsConfigBuilder
fn default() -> ServerTlsConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ServerTlsConfigBuilder
impl RefUnwindSafe for ServerTlsConfigBuilder
impl Send for ServerTlsConfigBuilder
impl Sync for ServerTlsConfigBuilder
impl Unpin for ServerTlsConfigBuilder
impl UnsafeUnpin for ServerTlsConfigBuilder
impl UnwindSafe for ServerTlsConfigBuilder
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