Struct ClientHelloShape
pub struct ClientHelloShape { /* private fields */ }boring and crypto and std only.Expand description
The cross-cutting choices that shape one connection’s ClientHello.
Lists (ciphers, groups, key shares, versions, signature algorithms and the extension order) are set with their own setters, as they appear on the wire: a GREASE codepoint in a list marks a GREASE slot at that position, and a set list has no other GREASE values. The extension order orders: the extensions it lists come first, then the other extensions this connection enables, natively. Which extensions are sent follows from the connection’s settings. This shape decides what those GREASE slots become, which native lists get GREASE, what happens to values the connection cannot negotiate, the padding, and the bodies of GREASE and preserved extensions. Everything left unset keeps BoringSSL’s behaviour. All of it is combined when the ClientHello is written, so the order in which settings are applied does not matter.
With a real ECH configuration, GREASE slots and preserved extensions of the extension order do not apply (the encrypted ClientHello references the outer extensions natively); the order of known extensions still does.
Implementations§
§impl ClientHelloShape
impl ClientHelloShape
pub fn new() -> ClientHelloShape
pub fn set_grease_lists(&mut self, lists: GreaseLists) -> &mut ClientHelloShape
pub fn set_grease_lists(&mut self, lists: GreaseLists) -> &mut ClientHelloShape
Native lists that get a GREASE value, replacing the context’s GREASE settings for this connection. Unset, the context’s settings apply.
pub fn with_grease_lists(self, lists: GreaseLists) -> ClientHelloShape
pub fn set_grease_values( &mut self, values: GreaseValues, ) -> &mut ClientHelloShape
pub fn with_grease_values(self, values: GreaseValues) -> ClientHelloShape
pub fn set_unknown_values( &mut self, values: UnknownValues, ) -> &mut ClientHelloShape
pub fn with_unknown_values(self, values: UnknownValues) -> ClientHelloShape
pub fn set_padding(&mut self, padding: Padding) -> &mut ClientHelloShape
pub fn with_padding(self, padding: Padding) -> ClientHelloShape
pub fn set_legacy_extensions(&mut self, enabled: bool) -> &mut ClientHelloShape
pub fn set_legacy_extensions(&mut self, enabled: bool) -> &mut ClientHelloShape
Sends initial EMS and renegotiation_info with a TLS 1.3 minimum to match browser hellos.
pub fn with_legacy_extensions(self, enabled: bool) -> ClientHelloShape
pub fn set_ec_point_formats(&mut self, enabled: bool) -> &mut ClientHelloShape
pub fn set_ec_point_formats(&mut self, enabled: bool) -> &mut ClientHelloShape
Sends ec_point_formats, listing only uncompressed points ([0]), with
a TLS 1.3 minimum, as clients that also speak TLS 1.2 do. Below a
TLS 1.3 minimum it is always sent. A TLS 1.3 server never echoes it,
so negotiation is unchanged. Once sent, the extension order orders it
like any other extension.
pub fn with_ec_point_formats(self, enabled: bool) -> ClientHelloShape
pub fn set_omit_psk_key_exchange_modes(
&mut self,
omit: bool,
) -> &mut ClientHelloShape
pub fn set_omit_psk_key_exchange_modes( &mut self, omit: bool, ) -> &mut ClientHelloShape
Omits psk_key_exchange_modes from a ClientHello offering TLS 1.3, as clients that never resume do.
A pre_shared_key requires psk_key_exchange_modes (RFC 8446, section
4.2.9), so such a connection does not resume: it offers no session,
TLS 1.2 ones included, and so no early data, whatever session was set
or cached. A configured PSK credential fails the handshake with
NO_SUPPORTED_PSK_MODE. Tickets a server sends anyway still reach the
new-session callback; a later connection that sends the extension may
resume them.
pub fn with_omit_psk_key_exchange_modes(self, omit: bool) -> ClientHelloShape
pub fn set_ech_grease(
&mut self,
shape: Option<EchGreaseShape>,
) -> &mut ClientHelloShape
pub fn set_ech_grease( &mut self, shape: Option<EchGreaseShape>, ) -> &mut ClientHelloShape
Overrides ECH GREASE algorithms and payload length. None restores
BoringSSL’s randomized, hardware-dependent defaults. This does not
enable GREASE; see EchGreaseShape for enablement, real ECH and retry
behavior. This setting is independent of GreaseValues.
pub fn with_ech_grease(self, shape: Option<EchGreaseShape>) -> ClientHelloShape
pub fn set_extension_body(
&mut self,
id: ExtensionType,
body: impl Into<Vec<u8>>,
) -> &mut ClientHelloShape
pub fn set_extension_body( &mut self, id: ExtensionType, body: impl Into<Vec<u8>>, ) -> &mut ClientHelloShape
The body sent for extension id of the extension order: a GREASE
codepoint or a preserved extension BoringSSL does not build. GREASE
extensions default to an empty first and one-byte later body; preserved
extensions default to an empty body. A later body for id replaces it.
pub fn with_extension_body( self, id: ExtensionType, body: impl Into<Vec<u8>>, ) -> ClientHelloShape
Trait Implementations§
§impl Clone for ClientHelloShape
impl Clone for ClientHelloShape
§fn clone(&self) -> ClientHelloShape
fn clone(&self) -> ClientHelloShape
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ClientHelloShape
impl Debug for ClientHelloShape
§impl Default for ClientHelloShape
impl Default for ClientHelloShape
§fn default() -> ClientHelloShape
fn default() -> ClientHelloShape
impl Eq for ClientHelloShape
§impl PartialEq for ClientHelloShape
impl PartialEq for ClientHelloShape
impl StructuralPartialEq for ClientHelloShape
Auto Trait Implementations§
impl Freeze for ClientHelloShape
impl RefUnwindSafe for ClientHelloShape
impl Send for ClientHelloShape
impl Sync for ClientHelloShape
impl Unpin for ClientHelloShape
impl UnsafeUnpin for ClientHelloShape
impl UnwindSafe for ClientHelloShape
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more