Last active
June 23, 2023 21:53
-
-
Save jakswa/866778bd6d207a102c3b85153212e102 to your computer and use it in GitHub Desktop.
showing rustls error case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "rustls_conn_reset" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
error-chain = "*" | |
reqwest = { version = "0.11.8", default-features=false, features=["rustls-tls", "blocking"]} | |
# succeeds if you change it to: | |
# reqwest = { version = "0.11.8", features=["blocking"]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use error_chain::error_chain; | |
error_chain! { | |
foreign_links { | |
Io(std::io::Error); | |
HttpRequest(reqwest::Error); | |
} | |
} | |
fn main() -> Result<()> { | |
let res = reqwest::blocking::get("https://itsmarta.com/google_transit_feed/google_transit.zip")?; | |
println!("Status: {}", res.status()); | |
println!("Headers:\n{:#?}", res.headers()); | |
Ok(()) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Status: 200 OK | |
Headers: | |
{ | |
"cache-control": "public", | |
"content-type": "application/zip", | |
"last-modified": "Wed, 19 Apr 2023 03:39:24 GMT", | |
"accept-ranges": "bytes", | |
"server": "Microsoft-IIS/8.5", | |
"x-aspnet-version": "4.0.30319", | |
"x-powered-by": "ASP.NET", | |
"x-frame-options": "SAMEORIGIN", | |
"date": "Fri, 23 Jun 2023 21:48:26 GMT", | |
"content-length": "18545429", | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: Error(HttpRequest(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("itsmarta.com")), port: None, path: "/google_transit_feed/google_transit.zip", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" } }) }), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment