diff --git a/Cargo.lock b/Cargo.lock index 7a6108b2e7..19e3101e84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2421,8 +2421,10 @@ dependencies = [ "async-trait", "deno_core", "deno_error", + "deno_tls", "http-body-util", "hyper 1.4.1", + "hyper-rustls", "hyper-util", "log", "once_cell", diff --git a/ext/telemetry/Cargo.toml b/ext/telemetry/Cargo.toml index 4d00b82909..2e6ec7534b 100644 --- a/ext/telemetry/Cargo.toml +++ b/ext/telemetry/Cargo.toml @@ -17,8 +17,10 @@ path = "lib.rs" async-trait.workspace = true deno_core.workspace = true deno_error.workspace = true +deno_tls.workspace = true http-body-util.workspace = true hyper.workspace = true +hyper-rustls.workspace = true hyper-util.workspace = true log.workspace = true once_cell.workspace = true diff --git a/ext/telemetry/lib.rs b/ext/telemetry/lib.rs index d2f6d1f5ac..79574abe71 100644 --- a/ext/telemetry/lib.rs +++ b/ext/telemetry/lib.rs @@ -477,10 +477,14 @@ mod hyper_client { use std::task::Poll; use std::task::{self}; + use deno_tls::create_client_config; + use deno_tls::SocketUse; + use deno_tls::TlsKeys; use http_body_util::BodyExt; use http_body_util::Full; use hyper::body::Body as HttpBody; use hyper::body::Frame; + use hyper_rustls::HttpsConnector; use hyper_util::client::legacy::connect::HttpConnector; use hyper_util::client::legacy::Client; use opentelemetry_http::Bytes; @@ -494,13 +498,23 @@ mod hyper_client { // same as opentelemetry_http::HyperClient except it uses OtelSharedRuntime #[derive(Debug, Clone)] pub struct HyperClient { - inner: Client, + inner: Client, Body>, } impl HyperClient { pub fn new() -> Self { + let tls_config = create_client_config( + None, + vec![], + None, + TlsKeys::Null, + SocketUse::Http, + ) + .unwrap(); + let http_connector = HttpConnector::new(); + let connector = HttpsConnector::from((http_connector, tls_config)); Self { - inner: Client::builder(OtelSharedRuntime).build(HttpConnector::new()), + inner: Client::builder(OtelSharedRuntime).build(connector), } } }