Hello,
I have an issue with the .tls() of the warp crate.
I generate a cert and key with:
sudo openssl req -newkey rsa:4096 -nodes -sha512 -x509 -days 3650 -nodes -out cert.pem -keyout key.pem
The server code is:
warp::serve(routes)
.tls()
.cert_path("cert.pem")
.key_path("key.pem")
.run(server)
.await;
And the client code contains:
let client = reqwest::Client::builder()
.danger_accept_invalid_certs(true)
.danger_accept_invalid_hostnames(true)
.use_native_tls()
.build()?;
let res = client.post(&url)
.body("body")
.send()
.await;
And I get the following error:
error: reqwest::Error {
kind: Request,
url: "https://192.168.0.40:8080/",
source: hyper::Error(
Connect,
Ssl(
Error {
code: ErrorCode(
1,
),
cause: Some(
Ssl(
ErrorStack(
[
Error {
code: 336151578,
library: "SSL routines",
function: "ssl3_read_bytes",
reason: "tlsv1 alert decode error",
file: "../ssl/record/rec_layer_s3.c",
line: 1543,
data: "SSL alert number 50",
},
],
),
),
),
},
X509VerifyResult {
code: 0,
error: "ok",
},
),
),
}
However if i make the request with curl and the -k option, it works well. So my certificate generation seems ok.
Any idea regarding this error?
Thanks