actix-web: actix_web::client cannot use rust-tls for https
I tried to use actix_web::client::Client
to send a request to an https url. It works with the “ssl” feature, but not with the “rust-tls” feature.
I condensed it to this sample code:
use actix_rt::System;
use actix_web::client::Client;
use futures::lazy;
fn main() {
let resp = System::new("test").block_on(lazy(|| {
Client::default()
.get("https://www.rust-lang.org")
.send()
}));
println!("Response: {:?}", resp.unwrap());
}
With “ssl” it works and prints the response headers. With “rust-tls” I get Connect(SslIsNotSupported)
.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (7 by maintainers)
Commits related to this issue
- enable rust-tls feature for actix_web::client #1045 — committed to actix/actix-web by fafhrd91 5 years ago
I was able to successfully call with https in actix_web 4, awc 3.
Just got bitten by
Err(Connect(SslIsNotSupported))
too 😐. For posterity, and until this makes it to the documentation [1], please try the following (a.k.a. “enabling the SSL/TLS feature”).[1]: I am willing to open a PR to improve this. Where would you like this documented exactly?
In your
Cargo.toml
:Using
rustls
:Using
openssl
:In your
main.rs
:Somebody please share example how to do it with actix_web 3
https://github.com/actix/examples/issues/330 created
Is there a rustls example? I am getting connection timeout with rustls. Openssl is just impossible to compile in windows 10. Tried it for a day.
@Pzixel I was able to configure https requests by following
awc_https
example.Which returns
This is strange, but example never work on my machine, i always get something like:
The only way to make it work is to disable verification completely (which is not a case to work with)
Can anybody verify this example works out of the box on his machine? (https://github.com/actix/examples/blob/22c8eaae87775d3da53ea3a73067c1a228a3a3a4/awc_https/src/main.rs#L8-L12)
Also my “rustup show”:
I using windows 10 x64
Cool, I will try removing
reqwest
from my project then. Thanks. BRB with results (although not immediately, I need to switch to the task some moment later)