-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting HTTP version is overridden by ALPN #2116
Comments
I check source code.
then let's see here Lines 861 to 869 in e639bdc
You can see it read I also check native-tls backend with the following MWE, this issue stills. [dependencies]
reqwest = { version = "0.11.24", features = ["rustls", "native-tls-alpn", "socks"] }
tokio = { version = "1.36.0", features = ["full"] }
[patch.crates-io]
# patch to fix #2118
reqwest = { git = 'https://github.com/cxw620/lib_reqwest.git', rev = '8a8f839483a00e7d855cac35f5d49cd7df4e8abd' } #[tokio::main]
async fn main() {
let client = reqwest::Client::builder()
.use_native_tls()
// .use_rustls_tls()
// .proxy(reqwest::Proxy::all("socks5://127.0.0.1:20023").unwrap())
// .danger_accept_invalid_certs(true)
.build()
.unwrap();
let version = client
.get("https://www.google.com/")
.version(reqwest::Version::HTTP_11)
.send()
.await
.unwrap()
.version();
println!("{:?}", version); // get HTTP/2.0 instead of HTTP/1.1
} This issue will be hard to resolve. P.S.: |
MWE
This gives
HTTP/2.0
and when enabling rustls tracing you can see that it is setting the protocol to HTTP/2 based on ALPN.The text was updated successfully, but these errors were encountered: