Skip to main content

BoringClientConfigExt

Trait BoringClientConfigExt 

pub trait BoringClientConfigExt: Sized {
Show 59 methods // Required methods fn new_from_client_hello(hello: &ClientHello) -> Self; fn with_mimic_client_hello(self, hello: &ClientHello) -> Self; fn set_mimic_client_hello(&mut self, hello: &ClientHello) -> &mut Self; fn with_cipher_suites(self, suites: Vec<CipherSuite>) -> Self; fn set_cipher_suites(&mut self, suites: Vec<CipherSuite>) -> &mut Self; fn with_supported_groups(self, groups: Vec<SupportedGroup>) -> Self; fn set_supported_groups(&mut self, groups: Vec<SupportedGroup>) -> &mut Self; fn with_key_shares(self, groups: Vec<SupportedGroup>) -> Self; fn set_key_shares(&mut self, groups: Vec<SupportedGroup>) -> &mut Self; fn with_signature_schemes(self, schemes: Vec<SignatureScheme>) -> Self; fn set_signature_schemes( &mut self, schemes: Vec<SignatureScheme>, ) -> &mut Self; fn with_grease(self, enabled: bool) -> Self; fn set_grease(&mut self, enabled: bool) -> &mut Self; fn with_grease_signature_schemes(self, enabled: bool) -> Self; fn set_grease_signature_schemes(&mut self, enabled: bool) -> &mut Self; fn with_alps( self, protocols: Vec<ApplicationProtocol>, new_codepoint: bool, ) -> Self; fn set_alps( &mut self, protocols: Vec<ApplicationProtocol>, new_codepoint: bool, ) -> &mut Self; fn with_extension_order(self, order: Vec<ExtensionId>) -> Self; fn set_extension_order(&mut self, order: Vec<ExtensionId>) -> &mut Self; fn with_permute_extensions(self, enabled: bool) -> Self; fn set_permute_extensions(&mut self, enabled: bool) -> &mut Self; fn with_unknown_values(self, policy: UnknownValues) -> Self; fn set_unknown_values(&mut self, policy: UnknownValues) -> &mut Self; fn with_grease_values(self, values: GreaseValues) -> Self; fn set_grease_values(&mut self, values: GreaseValues) -> &mut Self; fn with_client_hello_padding(self, padding: Padding) -> Self; fn set_client_hello_padding(&mut self, padding: Padding) -> &mut Self; fn with_legacy_extensions(self, enabled: bool) -> Self; fn set_legacy_extensions(&mut self, enabled: bool) -> &mut Self; fn with_extension_presence(self, presence: BoringExtensionPresence) -> Self; fn set_extension_presence( &mut self, presence: BoringExtensionPresence, ) -> &mut Self; fn with_extension_bodies(self, bodies: Vec<(ExtensionId, Bytes)>) -> Self; fn set_extension_bodies( &mut self, bodies: Vec<(ExtensionId, Bytes)>, ) -> &mut Self; fn with_requested_trust_anchors( self, anchors: BoringRequestedTrustAnchors, ) -> Self; fn set_requested_trust_anchors( &mut self, anchors: BoringRequestedTrustAnchors, ) -> &mut Self; fn with_cert_compression( self, algorithms: Vec<CertificateCompressionAlgorithm>, ) -> Self; fn set_cert_compression( &mut self, algorithms: Vec<CertificateCompressionAlgorithm>, ) -> &mut Self; fn with_delegated_credentials(self, schemes: Vec<SignatureScheme>) -> Self; fn set_delegated_credentials( &mut self, schemes: Vec<SignatureScheme>, ) -> &mut Self; fn with_record_size_limit(self, limit: u16) -> Self; fn set_record_size_limit(&mut self, limit: u16) -> &mut Self; fn with_server_padding_request(self, bytes: impl Into<Option<u16>>) -> Self; fn set_server_padding_request( &mut self, bytes: impl Into<Option<u16>>, ) -> &mut Self; fn with_encrypted_client_hello(self, enabled: bool) -> Self; fn set_encrypted_client_hello(&mut self, enabled: bool) -> &mut Self; fn with_ech_grease(self, shape: EchGrease) -> Self; fn set_ech_grease(&mut self, shape: EchGrease) -> &mut Self; fn with_ocsp_stapling(self, enabled: bool) -> Self; fn set_ocsp_stapling(&mut self, enabled: bool) -> &mut Self; fn with_signed_cert_timestamps(self, enabled: bool) -> Self; fn set_signed_cert_timestamps(&mut self, enabled: bool) -> &mut Self; fn with_tls12_session_tickets(self, enabled: bool) -> Self; fn set_tls12_session_tickets(&mut self, enabled: bool) -> &mut Self; fn with_server_verify_cert_store(self, store: Arc<X509Store>) -> Self; fn set_server_verify_cert_store( &mut self, store: Arc<X509Store>, ) -> &mut Self; fn with_min_version(self, version: ProtocolVersion) -> Self; fn set_min_version(&mut self, version: ProtocolVersion) -> &mut Self; fn with_max_version(self, version: ProtocolVersion) -> Self; fn set_max_version(&mut self, version: ProtocolVersion) -> &mut Self;
}
Available on crate feature boring only.
Expand description

Boring-specific setters for TlsClientConfig.

Required Methods§

fn new_from_client_hello(hello: &ClientHello) -> Self

Create a new config that mimics the provided ClientHello

fn with_mimic_client_hello(self, hello: &ClientHello) -> Self

Layer the fingerprint pieces captured in a ClientHello onto this config.

fn set_mimic_client_hello(&mut self, hello: &ClientHello) -> &mut Self

Layer the fingerprint pieces captured in a ClientHello onto this config.

fn with_cipher_suites(self, suites: Vec<CipherSuite>) -> Self

Set the cipher suites to offer, in order.

fn set_cipher_suites(&mut self, suites: Vec<CipherSuite>) -> &mut Self

Set the cipher suites to offer, in order.

fn with_supported_groups(self, groups: Vec<SupportedGroup>) -> Self

Set the supported groups (named curves), in order.

fn set_supported_groups(&mut self, groups: Vec<SupportedGroup>) -> &mut Self

Set the supported groups (named curves), in order.

fn with_key_shares(self, groups: Vec<SupportedGroup>) -> Self

Send key shares for exactly these groups, in order.

Groups missing from the offered groups, or out of their order, are skipped. Without this, BoringSSL sends at most two, at most one post-quantum.

fn set_key_shares(&mut self, groups: Vec<SupportedGroup>) -> &mut Self

Send key shares for exactly these groups, in order.

Groups missing from the offered groups, or out of their order, are skipped. Without this, BoringSSL sends at most two, at most one post-quantum.

fn with_signature_schemes(self, schemes: Vec<SignatureScheme>) -> Self

Set the signature schemes to advertise, in order.

fn set_signature_schemes(&mut self, schemes: Vec<SignatureScheme>) -> &mut Self

Set the signature schemes to advertise, in order.

fn with_grease(self, enabled: bool) -> Self

Enable/disable GREASE injection.

fn set_grease(&mut self, enabled: bool) -> &mut Self

Enable/disable GREASE injection.

fn with_grease_signature_schemes(self, enabled: bool) -> Self

Lead the signature schemes with a GREASE value (default: disabled).

Independent of grease.

fn set_grease_signature_schemes(&mut self, enabled: bool) -> &mut Self

Lead the signature schemes with a GREASE value (default: disabled).

Independent of grease.

fn with_alps( self, protocols: Vec<ApplicationProtocol>, new_codepoint: bool, ) -> Self

Set Application-Layer Protocol Settings (ALPS).

fn set_alps( &mut self, protocols: Vec<ApplicationProtocol>, new_codepoint: bool, ) -> &mut Self

Set Application-Layer Protocol Settings (ALPS).

fn with_extension_order(self, order: Vec<ExtensionId>) -> Self

Set the ClientHello extension prefix order; unlisted extensions follow. With GREASE on, an order naming no GREASE codepoint gets the native slots, first and last; an empty order keeps the native layout.

fn set_extension_order(&mut self, order: Vec<ExtensionId>) -> &mut Self

Set the ClientHello extension prefix order; unlisted extensions follow. With GREASE on, an order naming no GREASE codepoint gets the native slots, first and last; an empty order keeps the native layout.

fn with_permute_extensions(self, enabled: bool) -> Self

Permute the extension order for every handshake (default: disabled), as Chromium-based browsers do.

Takes precedence over an explicit extension_order, which still applies once permutation is disabled again. Native GREASE, padding and pre-shared-key placement rules remain in force.

fn set_permute_extensions(&mut self, enabled: bool) -> &mut Self

Permute the extension order for every handshake (default: disabled), as Chromium-based browsers do.

Takes precedence over an explicit extension_order, which still applies once permutation is disabled again. Native GREASE, padding and pre-shared-key placement rules remain in force.

fn with_unknown_values(self, policy: UnknownValues) -> Self

What to do with listed values BoringSSL cannot negotiate (groups, signature schemes, extensions): drop them (the default), send them as listed (UnknownValues::Preserve: a server that selects or answers one fails the handshake), or fail (UnknownValues::Forbid).

fn set_unknown_values(&mut self, policy: UnknownValues) -> &mut Self

What to do with listed values BoringSSL cannot negotiate (groups, signature schemes, extensions): drop them (the default), send them as listed (UnknownValues::Preserve: a server that selects or answers one fails the handshake), or fail (UnknownValues::Forbid).

fn with_grease_values(self, values: GreaseValues) -> Self

How GREASE slots are filled: fresh per connection (the default), from a seed, or exactly the listed codepoints (GreaseValues::Pinned, for a relay that mirrors its client).

fn set_grease_values(&mut self, values: GreaseValues) -> &mut Self

How GREASE slots are filled: fresh per connection (the default), from a seed, or exactly the listed codepoints (GreaseValues::Pinned, for a relay that mirrors its client).

fn with_client_hello_padding(self, padding: Padding) -> Self

Control ClientHello padding independently of extension order. Native padding is the default; explicit modes affect connection reuse.

fn set_client_hello_padding(&mut self, padding: Padding) -> &mut Self

Control ClientHello padding independently of extension order. Native padding is the default; explicit modes affect connection reuse.

fn with_legacy_extensions(self, enabled: bool) -> Self

Send extended_master_secret and renegotiation_info even when the minimum version is TLS 1.3, as some browsers do over QUIC. Off by default.

fn set_legacy_extensions(&mut self, enabled: bool) -> &mut Self

Send extended_master_secret and renegotiation_info even when the minimum version is TLS 1.3, as some browsers do over QUIC. Off by default.

fn with_extension_presence(self, presence: BoringExtensionPresence) -> Self

Whether the TLS 1.3 ClientHello sends ec_point_formats and omits psk_key_exchange_modes, as some clients do. Native presence by default.

fn set_extension_presence( &mut self, presence: BoringExtensionPresence, ) -> &mut Self

Whether the TLS 1.3 ClientHello sends ec_point_formats and omits psk_key_exchange_modes, as some clients do. Native presence by default.

fn with_extension_bodies(self, bodies: Vec<(ExtensionId, Bytes)>) -> Self

Bodies of GREASE extensions and of preserved extensions BoringSSL does not build itself, as a mimicked ClientHello sent them.

fn set_extension_bodies( &mut self, bodies: Vec<(ExtensionId, Bytes)>, ) -> &mut Self

Bodies of GREASE extensions and of preserved extensions BoringSSL does not build itself, as a mimicked ClientHello sent them.

fn with_requested_trust_anchors( self, anchors: BoringRequestedTrustAnchors, ) -> Self

Set requested trust anchor identifiers without changing certificate verification.

fn set_requested_trust_anchors( &mut self, anchors: BoringRequestedTrustAnchors, ) -> &mut Self

Set requested trust anchor identifiers without changing certificate verification.

fn with_cert_compression( self, algorithms: Vec<CertificateCompressionAlgorithm>, ) -> Self

Set certificate compression algorithms to advertise.

fn set_cert_compression( &mut self, algorithms: Vec<CertificateCompressionAlgorithm>, ) -> &mut Self

Set certificate compression algorithms to advertise.

fn with_delegated_credentials(self, schemes: Vec<SignatureScheme>) -> Self

Set delegated credential signature schemes.

fn set_delegated_credentials( &mut self, schemes: Vec<SignatureScheme>, ) -> &mut Self

Set delegated credential signature schemes.

fn with_record_size_limit(self, limit: u16) -> Self

Set the record_size_limit value; 0 omits the extension.

fn set_record_size_limit(&mut self, limit: u16) -> &mut Self

Set the record_size_limit value; 0 omits the extension.

fn with_server_padding_request(self, bytes: impl Into<Option<u16>>) -> Self

Request experimental server certificate padding on each new SSL. None omits it; Some(0) explicitly requests zero bytes. This does not require the server to respond or change certificate verification.

fn set_server_padding_request( &mut self, bytes: impl Into<Option<u16>>, ) -> &mut Self

Request experimental server certificate padding on each new SSL. None omits it; Some(0) explicitly requests zero bytes. This does not require the server to respond or change certificate verification.

fn with_encrypted_client_hello(self, enabled: bool) -> Self

Enable/disable Encrypted ClientHello (ECH) GREASE.

fn set_encrypted_client_hello(&mut self, enabled: bool) -> &mut Self

Enable/disable Encrypted ClientHello (ECH) GREASE.

fn with_ech_grease(self, shape: EchGrease) -> Self

Select the algorithms and lengths of ECH GREASE. Enable emission with encrypted_client_hello; invalid shapes fail when building a connector.

fn set_ech_grease(&mut self, shape: EchGrease) -> &mut Self

Select the algorithms and lengths of ECH GREASE. Enable emission with encrypted_client_hello; invalid shapes fail when building a connector.

fn with_ocsp_stapling(self, enabled: bool) -> Self

Enable/disable OCSP stapling request.

fn set_ocsp_stapling(&mut self, enabled: bool) -> &mut Self

Enable/disable OCSP stapling request.

fn with_signed_cert_timestamps(self, enabled: bool) -> Self

Enable/disable signed certificate timestamps request.

fn set_signed_cert_timestamps(&mut self, enabled: bool) -> &mut Self

Enable/disable signed certificate timestamps request.

fn with_tls12_session_tickets(self, enabled: bool) -> Self

Offer TLS 1.2 session tickets via the session_ticket extension (default: enabled).

TLS 1.3 tickets travel in pre_shared_key instead and are unaffected.

fn set_tls12_session_tickets(&mut self, enabled: bool) -> &mut Self

Offer TLS 1.2 session tickets via the session_ticket extension (default: enabled).

TLS 1.3 tickets travel in pre_shared_key instead and are unaffected.

fn with_server_verify_cert_store(self, store: Arc<X509Store>) -> Self

Set a custom server-certificate verification store (custom CA roots).

Ignored with ServerVerifyMode::Disable; takes precedence over common server trust policy.

fn set_server_verify_cert_store(&mut self, store: Arc<X509Store>) -> &mut Self

Set a custom server-certificate verification store (custom CA roots).

Ignored with ServerVerifyMode::Disable; takes precedence over common server trust policy.

fn with_min_version(self, version: ProtocolVersion) -> Self

Set the minimum TLS version boring will negotiate.

fn set_min_version(&mut self, version: ProtocolVersion) -> &mut Self

Set the minimum TLS version boring will negotiate.

fn with_max_version(self, version: ProtocolVersion) -> Self

Cap the maximum TLS version boring will negotiate.

fn set_max_version(&mut self, version: ProtocolVersion) -> &mut Self

Cap the maximum TLS version boring will negotiate.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§