pub struct ClientTlsConfigBuilder { /* private fields */ }Expand description
Incremental builder for ClientTlsConfig.
Implementations§
Source§impl ClientTlsConfigBuilder
impl ClientTlsConfigBuilder
Sourcepub fn ca(self, src: PemSource) -> Self
pub fn ca(self, src: PemSource) -> Self
Set the trusted CA bundle (verifies the server’s certificate).
Sourcepub fn client_cert(self, src: PemSource) -> Self
pub fn client_cert(self, src: PemSource) -> Self
Set the client certificate chain.
Sourcepub fn client_key(self, src: PemSource) -> Self
pub fn client_key(self, src: PemSource) -> Self
Set the client private key.
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 HTTP (default is empty).
Sourcepub fn ca_pem_file(self, path: impl Into<PathBuf>) -> Self
pub fn ca_pem_file(self, path: impl Into<PathBuf>) -> Self
Convenience: trusted CA bundle from a file path.
Sourcepub fn ca_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
pub fn ca_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
Convenience: trusted CA bundle from in-memory bytes.
Sourcepub fn client_cert_pem_file(self, path: impl Into<PathBuf>) -> Self
pub fn client_cert_pem_file(self, path: impl Into<PathBuf>) -> Self
Convenience: client cert chain from a file path.
Sourcepub fn client_cert_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
pub fn client_cert_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
Convenience: client cert chain from in-memory bytes.
Sourcepub fn client_key_pem_file(self, path: impl Into<PathBuf>) -> Self
pub fn client_key_pem_file(self, path: impl Into<PathBuf>) -> Self
Convenience: client private key from a file path.
Sourcepub fn client_key_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
pub fn client_key_pem_bytes(self, bytes: impl Into<Vec<u8>>) -> Self
Convenience: client private key from in-memory bytes.
Sourcepub fn build(self) -> Result<ClientTlsConfig, TlsError>
pub fn build(self) -> Result<ClientTlsConfig, TlsError>
Build.
Trait Implementations§
Source§impl Clone for ClientTlsConfigBuilder
impl Clone for ClientTlsConfigBuilder
Source§fn clone(&self) -> ClientTlsConfigBuilder
fn clone(&self) -> ClientTlsConfigBuilder
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 ClientTlsConfigBuilder
impl Debug for ClientTlsConfigBuilder
Source§impl Default for ClientTlsConfigBuilder
impl Default for ClientTlsConfigBuilder
Source§fn default() -> ClientTlsConfigBuilder
fn default() -> ClientTlsConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientTlsConfigBuilder
impl RefUnwindSafe for ClientTlsConfigBuilder
impl Send for ClientTlsConfigBuilder
impl Sync for ClientTlsConfigBuilder
impl Unpin for ClientTlsConfigBuilder
impl UnsafeUnpin for ClientTlsConfigBuilder
impl UnwindSafe for ClientTlsConfigBuilder
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