Trait QuicClientConfigProvider
pub trait QuicClientConfigProvider: TlsClientConfigProvider {
// Required methods
fn client_config(
&self,
config: &TlsClientConfig,
options: TlsOptions,
) -> Result<ClientConfig, TlsConfigError>;
fn peer_matches_name(
&self,
extensions: &Extensions,
leaf: &CertificateDer<'_>,
name: &Host,
) -> bool;
// Provided methods
fn session_defaults(&self) -> Option<Extensions> { ... }
fn prepare_client_config(
&self,
_policy: &TlsClientConfig,
_options: TlsOptions,
_peer: Host,
_handshake: ClientHandshake,
) -> Result<Option<ClientConfig>, TlsConfigError> { ... }
}quic and std only.Expand description
Build QUIC TLS configurations from Rama settings using a fixed provider.
This is the request-configuration boundary; the lower-level session provider
interface remains available through ClientConfig::new. Custom providers use
this same interface for construction, pool identity and server authentication.
Built-in providers apply common Rama TLS settings and their own native extensions, ignoring other providers’ native settings. Construction, authentication claims and pool identity describe the settings actually applied. Different connectors can therefore use different TLS policies.
Required Methods§
fn client_config(
&self,
config: &TlsClientConfig,
options: TlsOptions,
) -> Result<ClientConfig, TlsConfigError>
fn client_config( &self, config: &TlsClientConfig, options: TlsOptions, ) -> Result<ClientConfig, TlsConfigError>
Apply the final TLS settings and client handshake policy in options.
Fresh clients must neither consult nor populate session-ticket stores,
including stores supplied through native configuration hooks.
fn peer_matches_name(
&self,
extensions: &Extensions,
leaf: &CertificateDer<'_>,
name: &Host,
) -> bool
fn peer_matches_name( &self, extensions: &Extensions, leaf: &CertificateDer<'_>, name: &Host, ) -> bool
Whether the peer leaf of a connection authenticated under the effective
configuration in extensions is also valid for name, including any pins
scoped to it. Providers that cannot tell return false; a pin scoped to name
on an intermediate or root never matches the leaf, so it fails closed.
Provided Methods§
fn session_defaults(&self) -> Option<Extensions>
fn session_defaults(&self) -> Option<Extensions>
Optional connector-local backend session state shared by sibling configurations. These extensions hold cache metadata; they must not replace TLS security settings. The default retains each native configuration’s own session state.
fn prepare_client_config(
&self,
_policy: &TlsClientConfig,
_options: TlsOptions,
_peer: Host,
_handshake: ClientHandshake,
) -> Result<Option<ClientConfig>, TlsConfigError>
fn prepare_client_config( &self, _policy: &TlsClientConfig, _options: TlsOptions, _peer: Host, _handshake: ClientHandshake, ) -> Result<Option<ClientConfig>, TlsConfigError>
Prepare peer-bound native TLS state without connection I/O. Prepared configurations bypass ordinary caches because their first native session belongs to this peer; retries obtain fresh ephemeral state.
handshake controls ticket offers; options still controls ticket
retention and early data. Authentication and credentials remain policy.
Return None if this provider cannot prepare native sessions.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl QuicClientConfigProvider for BoringTlsProvider
boring only.impl QuicClientConfigProvider for RustlsTlsProvider
rustls and (crate features aws-lc or ring) only.