Skip to content

Commit a0946f0

Browse files
djcrami3l
authored andcommitted
Set ALPN protocols for rustls backend
1 parent bdefc8a commit a0946f0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/download/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -581,17 +581,17 @@ mod reqwest_be {
581581

582582
#[cfg(feature = "reqwest-rustls-tls")]
583583
pub(super) static CLIENT_RUSTLS_TLS: LazyLock<Client> = LazyLock::new(|| {
584+
let mut tls_config =
585+
rustls::ClientConfig::builder_with_provider(Arc::new(aws_lc_rs::default_provider()))
586+
.with_safe_default_protocol_versions()
587+
.unwrap()
588+
.with_platform_verifier()
589+
.with_no_client_auth();
590+
tls_config.alpn_protocols = vec![b"http/1.1".to_vec()];
591+
584592
let catcher = || {
585593
client_generic()
586-
.use_preconfigured_tls(
587-
rustls::ClientConfig::builder_with_provider(Arc::new(
588-
aws_lc_rs::default_provider(),
589-
))
590-
.with_safe_default_protocol_versions()
591-
.unwrap()
592-
.with_platform_verifier()
593-
.with_no_client_auth(),
594-
)
594+
.use_preconfigured_tls(tls_config)
595595
.user_agent(super::REQWEST_RUSTLS_TLS_USER_AGENT)
596596
.build()
597597
};

0 commit comments

Comments
 (0)