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

[bug][android] https request failed with handshakefailure #6770

Closed
Meteplus opened this issue Apr 22, 2023 · 4 comments
Closed

[bug][android] https request failed with handshakefailure #6770

Meteplus opened this issue Apr 22, 2023 · 4 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@Meteplus
Copy link

Meteplus commented Apr 22, 2023

Describe the bug

I used tauri::api::http::ClientBuilder and HttpRequestBuilder::new("POST", "https://...") to make a https request ,but i got this:

04-22 11:36:05.537 31981 32013 I RustStdoutStderr: thread 'tokio-runtime-worker' panicked at 'called Result::unwrap() on an Err value: Network(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("www.zhibei.biz")), port: None, path: "/tauri/marqo.jsp", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: AlertReceived(HandshakeFailure) } }) })', src\lib.rs:24:13
04-22 11:36:05.538 31981 32013 I RustStdoutStderr: note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

BUT,after changed the URL to http://... everything is ok!!!!!

Reproduction

No response

Expected behavior

No response

Platform and versions

tauri_2.0_alpha.08 
android

Stack trace

04-22 11:36:05.537 31981 32013 I RustStdoutStderr: thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Network(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("www.zhibei.biz")), port: None, path: "/tauri/marqo.jsp", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: AlertReceived(HandshakeFailure) } }) })', src\lib.rs:24:13
04-22 11:36:05.538 31981 32013 I RustStdoutStderr: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Additional context

No response

@Meteplus Meteplus added status: needs triage This issue needs to triage, applied to new issues type: bug labels Apr 22, 2023
@Meteplus Meteplus changed the title [bug] https request failed for handshakefailure [bug] https request failed with handshakefailure Apr 22, 2023
@Meteplus Meteplus changed the title [bug] https request failed with handshakefailure [bug][android] https request failed with handshakefailure Apr 22, 2023
@Meteplus
Copy link
Author

is this the same reason causes such an error?
seanmonstar/reqwest#923 (comment)

@Meteplus
Copy link
Author

Now I am sure it IS the SSL configuration on the server side causes this error, because I took a try to post to https://www.google.com the request done we'll and got namal responses

@Meteplus
Copy link
Author

Does tauri2.0 uses rustls for ssl? And the rustls does'nt support the weak or insecure ciphers such as
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 and so on,this caused same problems mentioned here: SeerLabs/CiteSeerX#80 (comment)

@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Sep 26, 2023
@Ballpin
Copy link

Ballpin commented Jun 8, 2024

For my part it was something with rust being stricter with the ssl certificate and the default cipher did not make the cut. I had to do this.

// cargo.toml
reqwest = { version = "0.12.4", default-features = false, features = ["json", "rustls-tls", "blocking"] }

// lib.rs

let client = reqwest::Client::builder().use_rustls_tls().build().unwrap();
let response = client.post("url").send().await?
let result: serde_json::Value = response.json().await?;

Note: Im new to rust and java so i don't know much about it. I just found it out by reading lots and lots of stuff.

Got also help from https://stackoverflow.com/questions/77825270/rust-reqwest-with-certificate-and-key-fails-to-be-authorised

@FabianLars FabianLars closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
Status: 📬Proposal
Development

No branches or pull requests

3 participants