-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add support for providing HttpConnector #254
Comments
What is the problem you're trying to solve? You're proposing a potential solution (which I don't completely understand) but I'd like to understand what your use case is. |
How about let tls: hyper_rustls::HttpsConnector = ...;
HttpsConnector::from((http_conn, tls)) |
Hey @ctz Error
But it did make me look one more time, and then I found the function/method I was looking for, called use log::info;
use hyper_util::client::legacy::connect::{HttpConnector};
use hyper_rustls;
pub(crate) fn get_https_connector(
network_interface: Option<String>
) -> hyper_rustls::HttpsConnector<HttpConnector> {
let mut http_conn = HttpConnector::new();
if let Some(network_interface) = network_interface {
info!("Using network interface: {}", network_interface);
http_conn.set_interface(network_interface);
}
let tls = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots().expect("no native root CA certificates found")
.https_or_http()
.enable_all_versions();
let https_conn = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots().expect("no native root CA certificates found")
.https_or_http()
.enable_all_versions().wrap_connector(http_conn);
https_conn
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
I want to ask if it would be possible to implement the
HttpsConnector::new_with_connector
which exists in the hyper_tls.https://docs.rs/hyper-tls/latest/hyper_tls/struct.HttpsConnector.html#method.new_with_connector
I need it so that I can specific the network interface as shown in the example below
It may also be that there is a way to do this with hyper-rustls, but I have not found it
The text was updated successfully, but these errors were encountered: