diff options
author | Ava Hahn <a.hahn@f5.com> | 2024-09-23 11:44:46 -0700 |
---|---|---|
committer | Ava Hahn <110854134+avahahn@users.noreply.github.com> | 2024-09-24 10:53:32 -0700 |
commit | 1c75aab380a24c3b8ebbac9059e9dc288812a83b (patch) | |
tree | 68fa343070e31a27d1d3da90a133b77ae1c11c52 /tools/unitctl/unit-client-rs/src/unit_client.rs | |
parent | a9d687e77059e801e956e7b7bb59637aa4708483 (diff) | |
download | unit-1c75aab380a24c3b8ebbac9059e9dc288812a83b.tar.gz unit-1c75aab380a24c3b8ebbac9059e9dc288812a83b.tar.bz2 |
tools/unitctl: use hyper-rustls instead of hyper-tls
Signed-off-by: Ava Hahn <a.hahn@f5.com>
Diffstat (limited to 'tools/unitctl/unit-client-rs/src/unit_client.rs')
-rw-r--r-- | tools/unitctl/unit-client-rs/src/unit_client.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/unitctl/unit-client-rs/src/unit_client.rs b/tools/unitctl/unit-client-rs/src/unit_client.rs index 3d09e67a..bc6cc4f7 100644 --- a/tools/unitctl/unit-client-rs/src/unit_client.rs +++ b/tools/unitctl/unit-client-rs/src/unit_client.rs @@ -9,7 +9,7 @@ use hyper::body::{Buf, HttpBody}; use hyper::client::{HttpConnector, ResponseFuture}; use hyper::Error as HyperError; use hyper::{http, Body, Client, Request}; -use hyper_tls::HttpsConnector; +use hyper_rustls::{HttpsConnectorBuilder, HttpsConnector}; use hyperlocal::{UnixClientExt, UnixConnector}; use serde::{Deserialize, Serialize}; @@ -185,7 +185,14 @@ impl UnitClient { } pub fn new_http(control_socket: ControlSocket) -> Self { - let remote_client = Client::builder().build(HttpsConnector::new()); + let remote_client = Client::builder() + .build(HttpsConnectorBuilder::default() + .with_native_roots() + .unwrap_or_else(|_| HttpsConnectorBuilder::default() + .with_webpki_roots()) + .https_or_http() + .enable_http1() + .wrap_connector(HttpConnector::new())); Self { control_socket, client: Box::from(RemoteClient::Tcp { client: remote_client }), |