Skip to content

Commit

Permalink
chore: use https when tls is present (#2671)
Browse files Browse the repository at this point in the history
* chore: use https

* chore: use tls
  • Loading branch information
shuiyisong authored Nov 1, 2023
1 parent 180bc64 commit 15a0775
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/common/grpc/src/channel_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ impl ChannelManager {
}

fn build_endpoint(&self, addr: &str) -> Result<Endpoint> {
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);
Expand Down

0 comments on commit 15a0775

Please sign in to comment.