diff --git a/src/common/grpc/src/channel_manager.rs b/src/common/grpc/src/channel_manager.rs index 98451f13eee7..e47722c4e2a2 100644 --- a/src/common/grpc/src/channel_manager.rs +++ b/src/common/grpc/src/channel_manager.rs @@ -163,7 +163,14 @@ impl ChannelManager { } fn build_endpoint(&self, addr: &str) -> Result { - let mut endpoint = Endpoint::new(format!("http://{addr}")).context(CreateChannelSnafu)?; + let http_prefix = if self.client_tls_config.is_some() { + "https" + } else { + "http" + }; + + let mut endpoint = + Endpoint::new(format!("{http_prefix}://{addr}")).context(CreateChannelSnafu)?; if let Some(dur) = self.config.timeout { endpoint = endpoint.timeout(dur);