Closed erfanium closed 4 years ago
url: https://api.kavenegar.com/v1
Cargo.toml
[dependencies] reqwest = { version = "0.10.8", default-features = false, features = ["rustls-tls", "stream", "gzip", "brotli"] } tokio = { version = "0.2", features = ["full"] }
main.rs
#[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let res = reqwest::Client::builder() .danger_accept_invalid_certs(true) .build() .unwrap() .get("https://api.kavenegar.com/v1") .send() .await?; println!("res: is {}", res.status()); Ok(()) }
log result:
Error: reqwest::Error { kind: Request, url: "https://api.kavenegar.com/v1", source: hyper::Error(Connect, Custom { kind: Other, error: Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" } }) }
I don't have any problem when I use openssl or native-tls What's wrong?
openssl
native-tls
Related: https://github.com/denoland/deno/issues/7528
I'm sorry, I don't know. Since you said it works with openssl, then it seems like a problem with rustls. It may be worth opening issue there.
@seanmonstar OK, I'm closing this now
url: https://api.kavenegar.com/v1
Cargo.toml
main.rs
log result:
I don't have any problem when I use
openssl
ornative-tls
What's wrong?