Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: simplify ClientConfigBuilder init
We can't derive `Default` on `ClientConfigBuilder` because we want to enable SNI by default. Instead, implement it by hand. This allows simplifying the construction sites to use the default except for the ~1/2 fields needing to be customized. Along the way, change where we initialize the default protocol versions. Previously we did this in `rustls_client_config_builder_new()`, but when we introduce ECH config it will be beneficial to know if the user has customized protocol versions using `rustls_client_config_builder_new_custom()` or just wants sensible defaults. This is easier to deduce if we defer populating the default protocol values to the time of `rustls_client_config_builder_build()` when we find the builder's protocol versions vec to be empty, indicating defaults are desired (explicitly customizing configuration for no protocols makes no sense).
- Loading branch information