Skip to content
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

os error 104: Connection reset by peer, when I use rustls #1039

Closed
erfanium opened this issue Sep 17, 2020 · 3 comments
Closed

os error 104: Connection reset by peer, when I use rustls #1039

erfanium opened this issue Sep 17, 2020 · 3 comments

Comments

@erfanium
Copy link

erfanium commented Sep 17, 2020

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?

@erfanium
Copy link
Author

Related: denoland/deno#7528

@seanmonstar
Copy link
Owner

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.

@erfanium
Copy link
Author

@seanmonstar OK, I'm closing this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants