Skip to main content

SslConfigs

Struct SslConfigs 

Source
#[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

Source

pub const SSL_PROTOCOL_CONFIG: &str = "ssl.protocol"

Config key: ssl.protocol.

Source

pub const DEFAULT_SSL_PROTOCOL: &str = "TLSv1.3"

Default SSL protocol.

Source

pub const SSL_PROVIDER_CONFIG: &str = "ssl.provider"

Config key: ssl.provider.

Source

pub const SSL_CIPHER_SUITES_CONFIG: &str = "ssl.cipher.suites"

Config key: ssl.cipher.suites.

Source

pub const SSL_ENABLED_PROTOCOLS_CONFIG: &str = "ssl.enabled.protocols"

Config key: ssl.enabled.protocols.

Source

pub const DEFAULT_SSL_ENABLED_PROTOCOLS: &str = "TLSv1.2,TLSv1.3"

Default enabled SSL protocols.

Source

pub const SSL_KEYSTORE_TYPE_CONFIG: &str = "ssl.keystore.type"

Config key: ssl.keystore.type.

Source

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.

Source

pub const SSL_KEYSTORE_KEY_CONFIG: &str = "ssl.keystore.key"

Config key: ssl.keystore.key.

Source

pub const SSL_KEYSTORE_CERTIFICATE_CHAIN_CONFIG: &str = "ssl.keystore.certificate.chain"

Config key: ssl.keystore.certificate.chain.

Source

pub const SSL_TRUSTSTORE_CERTIFICATES_CONFIG: &str = "ssl.truststore.certificates"

Config key: ssl.truststore.certificates.

Source

pub const SSL_KEYSTORE_LOCATION_CONFIG: &str = "ssl.keystore.location"

Config key: ssl.keystore.location.

Source

pub const SSL_TRUSTSTORE_TYPE_CONFIG: &str = "ssl.truststore.type"

Config key: ssl.truststore.type.

Source

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.

Source

pub const SSL_TRUSTSTORE_LOCATION_CONFIG: &str = "ssl.truststore.location"

Config key: ssl.truststore.location.

Source

pub const SSL_KEYMANAGER_ALGORITHM_CONFIG: &str = "ssl.keymanager.algorithm"

Config key: ssl.keymanager.algorithm.

Source

pub const SSL_TRUSTMANAGER_ALGORITHM_CONFIG: &str = "ssl.trustmanager.algorithm"

Config key: ssl.trustmanager.algorithm.

Source

pub const SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG: &str = "ssl.endpoint.identification.algorithm"

Config key: ssl.endpoint.identification.algorithm.

Source

pub const DEFAULT_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: &str = "https"

Default endpoint identification algorithm (enables hostname verification).

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SslConfigs

Source§

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.3 as the protocol
  • the TLS provider’s default cipher suites
  • "https" endpoint identification (hostname verification enabled)
  • All optional locations and PEM values are None

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V