mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 17:48:30 +02:00
re-enable http/2 support
This commit is contained in:
@@ -49,7 +49,7 @@ log = "0.4.27"
|
|||||||
md5 = "0.8.0"
|
md5 = "0.8.0"
|
||||||
mime_guess = "2.0.5"
|
mime_guess = "2.0.5"
|
||||||
rand = "0.9.0"
|
rand = "0.9.0"
|
||||||
reqwest = { workspace = true, features = ["multipart", "cookies", "gzip", "brotli", "deflate", "json", "rustls-tls-manual-roots-no-provider", "socks"] }
|
reqwest = { workspace = true, features = ["multipart", "cookies", "gzip", "brotli", "deflate", "json", "rustls-tls-manual-roots-no-provider", "socks", "http2"] }
|
||||||
reqwest_cookie_store = { workspace = true }
|
reqwest_cookie_store = { workspace = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json = { workspace = true, features = ["raw_value"] }
|
serde_json = { workspace = true, features = ["raw_value"] }
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ pub fn get_config(validate_certificates: bool) -> ClientConfig {
|
|||||||
let config_builder = ClientConfig::builder_with_provider(arc_crypto_provider)
|
let config_builder = ClientConfig::builder_with_provider(arc_crypto_provider)
|
||||||
.with_safe_default_protocol_versions()
|
.with_safe_default_protocol_versions()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
if validate_certificates {
|
let mut client = if validate_certificates {
|
||||||
// Use platform-native verifier to validate certificates
|
// Use platform-native verifier to validate certificates
|
||||||
config_builder.with_platform_verifier().unwrap().with_no_client_auth()
|
config_builder.with_platform_verifier().unwrap().with_no_client_auth()
|
||||||
} else {
|
} else {
|
||||||
@@ -18,7 +18,10 @@ pub fn get_config(validate_certificates: bool) -> ClientConfig {
|
|||||||
.dangerous()
|
.dangerous()
|
||||||
.with_custom_certificate_verifier(Arc::new(NoVerifier))
|
.with_custom_certificate_verifier(Arc::new(NoVerifier))
|
||||||
.with_no_client_auth()
|
.with_no_client_auth()
|
||||||
}
|
};
|
||||||
|
// Required for http/2 support
|
||||||
|
client.alpn_protocols = vec![b"h2".to_vec(), b"http/1.1".to_vec()];
|
||||||
|
client
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copied from reqwest: https://github.com/seanmonstar/reqwest/blob/595c80b1fbcdab73ac2ae93e4edc3406f453df25/src/tls.rs#L608
|
// Copied from reqwest: https://github.com/seanmonstar/reqwest/blob/595c80b1fbcdab73ac2ae93e4edc3406f453df25/src/tls.rs#L608
|
||||||
|
|||||||
Reference in New Issue
Block a user