pub struct EchConfig {
pub(crate) config: EchConfigPayload,
pub(crate) suite: &'static dyn Hpke,
}
Expand description
Configuration for performing encrypted client hello.
Note: differs from the protocol-encoded EchConfig (EchConfigMsg
).
Fields§
§config: EchConfigPayload
The selected EchConfig.
suite: &'static dyn Hpke
An HPKE instance corresponding to a suite from the config
we have selected as
a compatible choice.
Implementations§
Source§impl EchConfig
impl EchConfig
Sourcepub fn new(
ech_config_list: EchConfigListBytes<'_>,
hpke_suites: &[&'static dyn Hpke],
) -> Result<Self, Error>
pub fn new( ech_config_list: EchConfigListBytes<'_>, hpke_suites: &[&'static dyn Hpke], ) -> Result<Self, Error>
Construct an EchConfig by selecting a ECH config from the provided bytes that is compatible with one of the given HPKE suites.
The config list bytes should be sourced from a DNS-over-HTTPS lookup resolving the HTTPS
resource record for the host name of the server you wish to connect via ECH,
and extracting the ECH configuration from the ech
parameter. The extracted bytes should
be base64 decoded to yield the EchConfigListBytes
you provide to rustls.
One of the provided ECH configurations must be compatible with the HPKE provider’s supported suites or an error will be returned.
See the ech-client.rs
example for a complete example of fetching ECH configs from DNS.
Sourcepub(crate) fn hpke_info(&self) -> Vec<u8>
pub(crate) fn hpke_info(&self) -> Vec<u8>
Compute the HPKE SetupBaseS
info
parameter for this ECH configuration.
See https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-17#section-6.1.