Skip to content

Commit

Permalink
fix(tls): Don't use tls w/ http scheme (#1454)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucioFranco authored Aug 8, 2023
1 parent 4381610 commit 95e81f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tonic/src/transport/service/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ where
#[cfg(feature = "tls")]
{
if let Some(tls) = tls {
let conn = tls.connect(io).await?;
return Ok(BoxedIo::new(conn));
if is_https {
let conn = tls.connect(io).await?;
return Ok(BoxedIo::new(conn));
} else {
return Ok(BoxedIo::new(io));
}
} else if is_https {
return Err(HttpsUriWithoutTlsSupport(()).into());
}
Expand Down

0 comments on commit 95e81f5

Please sign in to comment.