Skip to main content

TlsClientConfigProvider

Trait TlsClientConfigProvider 

pub trait TlsClientConfigProvider:
    Debug
    + Send
    + Sync {
    // Required methods
    fn pool_id(&self, extensions: &Extensions) -> Option<TlsPoolId>;
    fn authenticates_server(&self, extensions: &Extensions) -> bool;

    // Provided method
    fn authenticates_origin(
        &self,
        extensions: &Extensions,
        origin: &Host,
    ) -> bool { ... }
}
Available on crate feature rustls only.
Expand description

Classify the request overrides understood by a fixed TLS configuration provider.

TLS connectors own this provider and publish their reuse rules after a handshake. Connector defaults remain fixed for the lifetime of its pool; custom providers participate through the same interface as built-in providers.

Required Methods§

fn pool_id(&self, extensions: &Extensions) -> Option<TlsPoolId>

Identity of request overrides, before connector defaults are applied.

None means the request does not change the provider’s fixed TLS policy, including server identity and authentication. Callers may then classify the fixed defaults directly. Use the builder to retain shared components; return a non-reusable ID only for policies whose identity cannot be tracked.

fn authenticates_server(&self, extensions: &Extensions) -> bool

Whether the effective configuration establishes the server identity.

Provided Methods§

fn authenticates_origin(&self, extensions: &Extensions, origin: &Host) -> bool

Whether this effective policy authenticates the requested HTTP origin.

Connectors call this with their effective configuration when checking an attempt’s peer requirement. Providers with additional identity semantics can refine it; successful handshake authentication is still reported separately on the established connection.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§