pub struct TlsConnectorConfig {
pub trust_roots_pem: Option<PathBuf>,
pub server_name: String,
pub client_identity: Option<(PathBuf, PathBuf)>,
}Expand description
Client-side TLS trust + SNI. Mirrors the trust-roots half of the
broker’s crabka_security::TlsConfig::build_client_config.
Fields§
§trust_roots_pem: Option<PathBuf>PEM file of CA certs the client trusts to verify the broker’s
server cert. None → empty root store (handshake fails unless
the server cert chains to a webpki default, which we do not
install — mirrors the broker’s strict build_client_config).
server_name: StringSNI / server-name used for the TLS handshake and as the canonical hostname for any GSSAPI SPN.
client_identity: Option<(PathBuf, PathBuf)>Optional mTLS client identity: (cert_chain_pem, private_key_pem).
When Some, the cert chain and key are loaded from the given PEM
files and presented to the server during the TLS handshake
(mutual TLS / client authentication). None → one-way TLS; the
client does not present a certificate (with_no_client_auth).
Implementations§
Source§impl TlsConnectorConfig
impl TlsConnectorConfig
Sourcepub fn build(&self) -> Result<Arc<ClientConfig>, String>
pub fn build(&self) -> Result<Arc<ClientConfig>, String>
Build a rustls::ClientConfig.
When Self::client_identity is Some, the cert chain and key are
loaded and the config is built with mutual TLS client authentication.
When None, the client presents no certificate (with_no_client_auth).
§Errors
Returns a string error if any PEM file fails to load or parse.
Sourcepub fn connector(&self) -> Result<TlsConnector, String>
pub fn connector(&self) -> Result<TlsConnector, String>
Trait Implementations§
Source§impl Clone for TlsConnectorConfig
impl Clone for TlsConnectorConfig
Source§fn clone(&self) -> TlsConnectorConfig
fn clone(&self) -> TlsConnectorConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more