pub struct ClientTLSConfigBuilder { /* private fields */ }Expand description
A TLS client configuration builder.
Exposes various options for configuring a client’s TLS configuration that would otherwise be cumbersome to configure, and provides sane defaults for many common options.
§Missing
- ability to configure client authentication
Implementations§
Source§impl ClientTLSConfigBuilder
impl ClientTLSConfigBuilder
pub fn new() -> Self
Sourcepub fn with_key_log_file<P: Into<PathBuf>>(self, path: P) -> Self
pub fn with_key_log_file<P: Into<PathBuf>>(self, path: P) -> Self
Enables logging of TLS key material to the given file path.
TLS key material will be logged to the given file path in the NSS Key Log format, which can be used for debugging TLS issues, as well as decrypting captured TLS traffic in tools such as Wireshark.
Newly created files are created with owner read/write permissions on Unix. Existing file permissions are preserved.
Sourcepub fn with_max_tls12_resumption_sessions(self, max: usize) -> Self
pub fn with_max_tls12_resumption_sessions(self, max: usize) -> Self
Sets the maximum number of TLS 1.2 sessions to cache.
Defaults to 8.
Sourcepub fn with_root_cert_store(self, store: RootCertStore) -> Self
pub fn with_root_cert_store(self, store: RootCertStore) -> Self
Sets the root certificate store to use for the client.
Defaults to the “default” root certificate store initialized from the platform. (See load_platform_root_certificates.)
Sourcepub fn with_min_tls_version(self, version: TlsMinimumVersion) -> Self
pub fn with_min_tls_version(self, version: TlsMinimumVersion) -> Self
Sets the minimum TLS protocol version to allow for client connections.
Defaults to TLS 1.2.
Sourcepub fn danger_accept_invalid_certs(self) -> Self
pub fn danger_accept_invalid_certs(self) -> Self
Disables server certificate verification entirely.
This is inherently insecure and should only be used for local/development connections where the server’s identity is already established through other means (for example, connecting via Unix domain socket to a local process).
Sourcepub fn build(self) -> Result<ClientConfig, GenericError>
pub fn build(self) -> Result<ClientConfig, GenericError>
Builds the client TLS configuration.
§Errors
If the default root cert store (see load_platform_root_certificates) hasn’t been initialized, and a root
cert store hasn’t been provided, or if the resulting configuration isn’t FIPS compliant, an error will be
returned.
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read moreSource§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more