From b9e2ce08935f1786e6b5c0caf97e0945e6cace08 Mon Sep 17 00:00:00 2001 From: Guilhem Vallat Date: Wed, 10 Jul 2024 17:48:55 +0200 Subject: [PATCH] Revert "fix: Return error on non https uri instead of panic (#838)" This reverts commit ef6e245180936097e56f5f95ed8b182674f3131b. --- .../src/transport/channel/service/connector.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tonic/src/transport/channel/service/connector.rs b/tonic/src/transport/channel/service/connector.rs index 146dc94ed..6ec050d7d 100644 --- a/tonic/src/transport/channel/service/connector.rs +++ b/tonic/src/transport/channel/service/connector.rs @@ -83,8 +83,6 @@ where } else { Ok(BoxedIo::new(io)) }; - } else if is_https { - return Err(HttpsUriWithoutTlsSupport(()).into()); } } @@ -95,19 +93,3 @@ where }) } } - -/// Error returned when trying to connect to an HTTPS endpoint without TLS enabled. -#[cfg(feature = "tls")] -#[derive(Debug)] -pub(crate) struct HttpsUriWithoutTlsSupport(()); - -#[cfg(feature = "tls")] -impl fmt::Display for HttpsUriWithoutTlsSupport { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "Connecting to HTTPS without TLS enabled") - } -} - -// std::error::Error only requires a type to impl Debug and Display -#[cfg(feature = "tls")] -impl std::error::Error for HttpsUriWithoutTlsSupport {}