#[non_exhaustive]pub struct SslConfigs { /* private fields */ }Expand description
SSL/TLS configuration for Kafka connections.
The Java class
hosts only the ssl.* config keys and defaults; the values themselves
travel in the Map<String, ?> handed to SslFactory.configure. The Rust
struct keeps Java’s name and constants, and additionally holds the
client-relevant subset of those values, parsed once from the client config
properties. The fields are crate-private: callers set them through the
ssl.* properties of a client config, as a Java caller does.
truststore_type and keystore_type default to "PEM"
(DEFAULT_SSL_KEYSTORE_TYPE), where
Java defaults to JKS.
Every field whose key Java defines as ConfigDef.Type.PASSWORD is a
Password, so the derived Debug renders each of them as [hidden].
Implementations§
Source§impl SslConfigs
impl SslConfigs
Sourcepub const SSL_PROTOCOL_CONFIG: &str = "ssl.protocol"
pub const SSL_PROTOCOL_CONFIG: &str = "ssl.protocol"
Config key: ssl.protocol.
Sourcepub const DEFAULT_SSL_PROTOCOL: &str = "TLSv1.3"
pub const DEFAULT_SSL_PROTOCOL: &str = "TLSv1.3"
Default SSL protocol.
Sourcepub const SSL_PROVIDER_CONFIG: &str = "ssl.provider"
pub const SSL_PROVIDER_CONFIG: &str = "ssl.provider"
Config key: ssl.provider.
Sourcepub const SSL_CIPHER_SUITES_CONFIG: &str = "ssl.cipher.suites"
pub const SSL_CIPHER_SUITES_CONFIG: &str = "ssl.cipher.suites"
Config key: ssl.cipher.suites.
Sourcepub const SSL_ENABLED_PROTOCOLS_CONFIG: &str = "ssl.enabled.protocols"
pub const SSL_ENABLED_PROTOCOLS_CONFIG: &str = "ssl.enabled.protocols"
Config key: ssl.enabled.protocols.
Sourcepub const DEFAULT_SSL_ENABLED_PROTOCOLS: &str = "TLSv1.2,TLSv1.3"
pub const DEFAULT_SSL_ENABLED_PROTOCOLS: &str = "TLSv1.2,TLSv1.3"
Default enabled SSL protocols.
Sourcepub const SSL_KEYSTORE_TYPE_CONFIG: &str = "ssl.keystore.type"
pub const SSL_KEYSTORE_TYPE_CONFIG: &str = "ssl.keystore.type"
Config key: ssl.keystore.type.
Sourcepub const DEFAULT_SSL_KEYSTORE_TYPE: &str = "PEM"
pub const DEFAULT_SSL_KEYSTORE_TYPE: &str = "PEM"
Default for ssl.keystore.type: PEM.
This deviates from Java, whose DEFAULT_SSL_KEYSTORE_TYPE is JKS
(org.apache.kafka.common.config.SslConfigs#DEFAULT_SSL_KEYSTORE_TYPE): the rustls-based SSL factory reads only PEM and
rejects JKS and PKCS12, so Java’s default would make every TLS client
fail to construct.
Sourcepub const SSL_KEYSTORE_KEY_CONFIG: &str = "ssl.keystore.key"
pub const SSL_KEYSTORE_KEY_CONFIG: &str = "ssl.keystore.key"
Config key: ssl.keystore.key.
Sourcepub const SSL_KEYSTORE_CERTIFICATE_CHAIN_CONFIG: &str = "ssl.keystore.certificate.chain"
pub const SSL_KEYSTORE_CERTIFICATE_CHAIN_CONFIG: &str = "ssl.keystore.certificate.chain"
Config key: ssl.keystore.certificate.chain.
Sourcepub const SSL_TRUSTSTORE_CERTIFICATES_CONFIG: &str = "ssl.truststore.certificates"
pub const SSL_TRUSTSTORE_CERTIFICATES_CONFIG: &str = "ssl.truststore.certificates"
Config key: ssl.truststore.certificates.
Sourcepub const SSL_KEYSTORE_LOCATION_CONFIG: &str = "ssl.keystore.location"
pub const SSL_KEYSTORE_LOCATION_CONFIG: &str = "ssl.keystore.location"
Config key: ssl.keystore.location.
Sourcepub const SSL_TRUSTSTORE_TYPE_CONFIG: &str = "ssl.truststore.type"
pub const SSL_TRUSTSTORE_TYPE_CONFIG: &str = "ssl.truststore.type"
Config key: ssl.truststore.type.
Sourcepub const DEFAULT_SSL_TRUSTSTORE_TYPE: &str = "PEM"
pub const DEFAULT_SSL_TRUSTSTORE_TYPE: &str = "PEM"
Default for ssl.truststore.type: PEM, deviating from Java’s JKS
(org.apache.kafka.common.config.SslConfigs#DEFAULT_SSL_TRUSTSTORE_TYPE) for the reason given at
DEFAULT_SSL_KEYSTORE_TYPE.
Sourcepub const SSL_TRUSTSTORE_LOCATION_CONFIG: &str = "ssl.truststore.location"
pub const SSL_TRUSTSTORE_LOCATION_CONFIG: &str = "ssl.truststore.location"
Config key: ssl.truststore.location.
Sourcepub const SSL_KEYMANAGER_ALGORITHM_CONFIG: &str = "ssl.keymanager.algorithm"
pub const SSL_KEYMANAGER_ALGORITHM_CONFIG: &str = "ssl.keymanager.algorithm"
Config key: ssl.keymanager.algorithm.
Sourcepub const SSL_TRUSTMANAGER_ALGORITHM_CONFIG: &str = "ssl.trustmanager.algorithm"
pub const SSL_TRUSTMANAGER_ALGORITHM_CONFIG: &str = "ssl.trustmanager.algorithm"
Config key: ssl.trustmanager.algorithm.
Sourcepub const SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG: &str = "ssl.endpoint.identification.algorithm"
pub const SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG: &str = "ssl.endpoint.identification.algorithm"
Config key: ssl.endpoint.identification.algorithm.
Sourcepub const DEFAULT_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: &str = "https"
pub const DEFAULT_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: &str = "https"
Default endpoint identification algorithm (enables hostname verification).
Sourcepub const SSL_SECURE_RANDOM_IMPLEMENTATION_CONFIG: &str = "ssl.secure.random.implementation"
pub const SSL_SECURE_RANDOM_IMPLEMENTATION_CONFIG: &str = "ssl.secure.random.implementation"
Config key: ssl.secure.random.implementation.
Trait Implementations§
Source§impl Debug for SslConfigs
impl Debug for SslConfigs
Source§impl Default for SslConfigs
impl Default for SslConfigs
Source§fn default() -> Self
fn default() -> Self
Returns an SslConfigs with sensible defaults for Rust/rustls:
- PEM format for both truststore and keystore
- TLSv1.2 and TLSv1.3 enabled,
TLSv1.3as the protocol - the TLS provider’s default cipher suites
"https"endpoint identification (hostname verification enabled)- All optional locations and PEM values are
None