You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I comment out .http2_prior_knowledge(), HTTP connection establish normally, though HTTP1.
This problem can only be reproduced when using proxy. I wonder whether this is a problem owing to reqwest or rustls itself. In my opinion, probably the latter one, because I also build a hyper Client (tonic, a gRPC rust implement, needs it for it currently doesn't support proxy and I have to implement it by myself) with tokio_native_tls::TlsConnector, and tonic works well.
Of course, the problem may be caused by my improper usage of reqwest, so I come here looking for help.
Full Example
Cargo.toml
chrono = "0.4.26"env_logger = "0.10.0"log = "0.4"tokio = { version = "1.29.1", features = ["full"] }
reqwest = { version = "0.11.18", features = ["blocking", "socks","brotli","gzip","deflate","rustls-tls", "native-tls-alpn", "json"] }
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm running into a sticky problem when using reqwest.
Here's how I build
reqwest::Client
:When enable feature
native-tls-alpn
and build client with.use_native_tls()
, everything works well, here's an example output.However, if I use the client built with
.use_rustls_tls()
instead of.use_native_tls()
, I got it panic:If I comment out
.http2_prior_knowledge()
, HTTP connection establish normally, though HTTP1.This problem can only be reproduced when using proxy. I wonder whether this is a problem owing to reqwest or rustls itself. In my opinion, probably the latter one, because I also build a hyper Client (tonic, a gRPC rust implement, needs it for it currently doesn't support proxy and I have to implement it by myself) with
tokio_native_tls::TlsConnector
, and tonic works well.Of course, the problem may be caused by my improper usage of reqwest, so I come here looking for help.
Full Example
Cargo.toml
Code:
Beta Was this translation helpful? Give feedback.
All reactions