Skip to content

Commit 95e81f5

Browse files
authoredAug 8, 2023
fix(tls): Don't use tls w/ http scheme (#1454)
1 parent 4381610 commit 95e81f5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎tonic/src/transport/service/connector.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,12 @@ where
8787
#[cfg(feature = "tls")]
8888
{
8989
if let Some(tls) = tls {
90-
let conn = tls.connect(io).await?;
91-
return Ok(BoxedIo::new(conn));
90+
if is_https {
91+
let conn = tls.connect(io).await?;
92+
return Ok(BoxedIo::new(conn));
93+
} else {
94+
return Ok(BoxedIo::new(io));
95+
}
9296
} else if is_https {
9397
return Err(HttpsUriWithoutTlsSupport(()).into());
9498
}

0 commit comments

Comments
 (0)
Please sign in to comment.