pub struct ClientSecurity {
pub protocol: ListenerProtocol,
pub tls: Option<TlsConnectorConfig>,
pub sasl: Option<SaslCredentials>,
pub sasl_host: Option<String>,
}Expand description
Full client security policy: which listener protocol to speak, plus
the TLS and SASL material it implies. None fields are required to
match protocol (a SaslSsl policy needs both tls and sasl).
Fields§
§protocol: ListenerProtocol§tls: Option<TlsConnectorConfig>§sasl: Option<SaslCredentials>§sasl_host: Option<String>Canonical hostname for the SASL handshake — the GSSAPI service
principal host (service_name/<sasl_host>). Meaningful whenever
the protocol requires_sasl, independent of TLS: a
SASL_PLAINTEXT listener has no tls to source the host from, so
without this GSSAPI would fall back to localhost and Kerberos
would reject the principal. None falls back to tls.server_name
then the connection’s target host. PLAIN/SCRAM ignore it.
Implementations§
Source§impl ClientSecurity
impl ClientSecurity
Sourcepub fn sasl_handshake_host<'a>(
&'a self,
target_host: Option<&'a str>,
) -> &'a str
pub fn sasl_handshake_host<'a>( &'a self, target_host: Option<&'a str>, ) -> &'a str
Resolve the hostname handed to the SASL handshake (the GSSAPI SPN
host). Prefers the explicit Self::sasl_host, then the TLS SNI
(TlsConnectorConfig::server_name), then the connection’s target
host if known, falling back to "localhost".
TLS SNI is unaffected — it is always sourced from tls.server_name.
Trait Implementations§
Source§impl Clone for ClientSecurity
impl Clone for ClientSecurity
Source§fn clone(&self) -> ClientSecurity
fn clone(&self) -> ClientSecurity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more