diff --git a/Cargo.lock b/Cargo.lock index a13535f3..3eba5b8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1821,6 +1821,9 @@ dependencies = [ "garage_util", "gethostname", "hex", + "hyper 1.9.0", + "hyper-rustls 0.27.9", + "hyper-util", "ipnet", "itertools 0.14.0", "k8s-openapi", @@ -1831,6 +1834,7 @@ dependencies = [ "pnet_datalink", "rand 0.9.4", "reqwest", + "rustls 0.23.39", "schemars", "serde", "serde_bytes", diff --git a/Cargo.toml b/Cargo.toml index 740e4db7..3d0a25eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,6 +121,7 @@ reqwest = { version = "0.13", default-features = false, features = [ "rustls-no-provider", "json", ] } +rustls = { version = "0.23", default-features = false, features = ["std", "ring"] } form_urlencoded = "1.2" http = "1.4" diff --git a/src/rpc/Cargo.toml b/src/rpc/Cargo.toml index e8e8e4b6..2e7d4bd3 100644 --- a/src/rpc/Cargo.toml +++ b/src/rpc/Cargo.toml @@ -41,6 +41,10 @@ kube = { workspace = true, optional = true } k8s-openapi = { workspace = true, optional = true } schemars = { workspace = true, optional = true } reqwest = { workspace = true, optional = true } +hyper = { workspace = true, optional = true } +hyper-rustls = { workspace = true, optional = true } +hyper-util = { workspace = true, optional = true } +rustls = { workspace = true, optional = true } pnet_datalink.workspace = true @@ -50,7 +54,7 @@ opentelemetry.workspace = true [features] kubernetes-discovery = ["kube", "k8s-openapi", "schemars"] -consul-discovery = ["reqwest", "thiserror"] +consul-discovery = ["hyper", "hyper-rustls", "hyper-util", "reqwest", "rustls", "thiserror"] system-libs = ["sodiumoxide/use-pkg-config"] [lints] diff --git a/src/rpc/consul.rs b/src/rpc/consul.rs index dea49995..53e92f42 100644 --- a/src/rpc/consul.rs +++ b/src/rpc/consul.rs @@ -80,6 +80,7 @@ pub struct ConsulDiscovery { impl ConsulDiscovery { pub fn new(config: ConsulDiscoveryConfig) -> Result { + _ = rustls::crypto::ring::default_provider().install_default(); let mut builder: reqwest::ClientBuilder = reqwest::Client::builder().use_rustls_tls(); if config.tls_skip_verify { builder = builder.danger_accept_invalid_certs(true);