hyper-rustls icon indicating copy to clipboard operation
hyper-rustls copied to clipboard

Allow construction with HttpConnector and default ClientConfig

Open jbg opened this issue 6 years ago • 1 comments

See for example the example code at hyper-trust-dns.

If I want to supply an HttpConnector, for example to change the resolver, it seems that I also have to also supply a ClientConfig.

It could be useful to offer a from(http_connector: T) which uses the default rustls ClientConfig.

jbg avatar Mar 04 '19 09:03 jbg

There's something like that on the main branch now (see #156), you can combine a builder (configuring HTTPS in a consistent and readable way) with a custom connector

let https = hyper_rustls::HttpsConnectorBuilder::new()
    .with_native_roots()
    .https_only()
    .enable_http1()
    .wrap_connector(http)

g2p avatar Nov 15 '21 10:11 g2p

Based on @g2p's comment above I'm going to close this ticket as resolved. If the updated API doesn't meet the needs of the original poster we can re-open for further discussion.

Thanks!

cpu avatar Apr 04 '23 14:04 cpu