Skip to content

Commit

Permalink
remove "tls not enabled" error when the tls feature is off
Browse files Browse the repository at this point in the history
  • Loading branch information
guswynn committed May 4, 2022
1 parent 2e19b66 commit 7ef4104
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions tonic/src/transport/service/connector.rs
Expand Up @@ -79,17 +79,11 @@ where
#[cfg(feature = "tls-roots-common")]
let tls = self.tls_or_default(uri.scheme_str(), uri.host());

#[cfg(feature = "tls")]
let is_https = uri.scheme_str() == Some("https");
let connect = self.inner.make_connection(uri);

Box::pin(async move {
#[cfg(not(feature = "tls"))]
{
if is_https {
return Err(HttpsUriWithoutTlsSupport(()).into());
}
}

let io = connect.await?;

#[cfg(feature = "tls")]
Expand Down

0 comments on commit 7ef4104

Please sign in to comment.