Comments (3)
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.
from hyper-rustls.
How about
let tls: hyper_rustls::HttpsConnector = ...;
HttpsConnector::from((http_conn, tls))
from hyper-rustls.
Hey @ctz
Your suggestion sadly did not work, keep getting the error
Error
the trait bound `Arc<rustls::client::client_conn::ClientConfig>: From<HttpsConnectorBuilder<WantsProtocols3>>` is not satisfied [E0277]
the trait `From<HttpsConnectorBuilder<WantsProtocols3>>` is not implemented for `Arc<rustls::client::client_conn::ClientConfig>`
Help: the following other types implement trait `From<T>`: <Arc<std::ffi::OsStr> as From<OsString>> <Arc<std::ffi::OsStr> as From<&std::ffi::OsStr>>
<Arc<Path> as From<PathBuf>>
<Arc<Path> as From<&Path>>
<Arc<CStr> as From<CString>>
<Arc<CStr> as From<&CStr>>
<Arc<str> as From<std::string::String>>
<Arc<str> as From<&str>> and 7 others
Note: required for `HttpsConnectorBuilder<WantsProtocols3>` to implement `Into<Arc<rustls::client::client_conn::ClientConfig>>`
Note: required for `hyper_rustls::HttpsConnector<HttpConnector>` to implement `From<(HttpConnector, HttpsConnectorBuilder<WantsProtocols3>)>`
But it did make me look one more time, and then I found the function/method I was looking for, called wrap_connector
.
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
}
from hyper-rustls.
Related Issues (20)
- Custom ALPN protocol HOT 3
- More elaborate custom server name HOT 1
- Cannot access peer certificates with example's TlsStream HOT 7
- `HttpsConnectorBuilder::enable_all_versions` doesn't enable ALPN for http/1.1 HOT 1
- Release TLSAcceptor HOT 2
- example of client with mutual tls HOT 3
- When used with a specified request the body is not decrypted HOT 2
- Getting ip address of connection HOT 1
- Creating an HTTPS connection using `HttpsConnectorBuilder` does not allow you to obtain the website's URL. HOT 1
- Hyper v1 compatibility HOT 12
- Release with rustls 0.22 support? HOT 5
- Release 0.25.0 without hyper 1 support? HOT 1
- Prepare v0.25 release, update to Rustls v0.22 HOT 5
- Prepare v0.26 release, update to Hyper 1.0 HOT 8
- v0.26 server example error: failed to serve connection: error shutting down connection HOT 2
- Rust minimum version should be updated HOT 4
- 0.23.2 of rusttls HOT 3
- Expose feature flag to enable FIPS compliant build of AWS-LC. HOT 1
- Latest version (0.27.1) fails to build for `docs.rs` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyper-rustls.