|
|
@@ -141,10 +141,6 @@ pub enum Error {
|
|
|
#[error("tungstenite error: {0}")]
|
|
|
TungsteniteError(String),
|
|
|
|
|
|
- #[cfg(feature = "async-native-tls")]
|
|
|
- #[error("async_native_tls error: {0}")]
|
|
|
- AsyncNativeTlsError(String),
|
|
|
-
|
|
|
#[error("Tor error: {0}")]
|
|
|
TorError(String),
|
|
|
|
|
|
@@ -183,6 +179,10 @@ pub enum Error {
|
|
|
#[error(transparent)]
|
|
|
RustlsError(#[from] futures_rustls::rustls::Error),
|
|
|
|
|
|
+ #[cfg(feature = "futures-rustls")]
|
|
|
+ #[error("Invalid DNS Name {0}")]
|
|
|
+ RustlsInvalidDns(String),
|
|
|
+
|
|
|
// =======================
|
|
|
// Protocol-related errors
|
|
|
// =======================
|
|
|
@@ -457,13 +457,6 @@ impl From<async_channel::RecvError> for Error {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#[cfg(feature = "async-native-tls")]
|
|
|
-impl From<async_native_tls::Error> for Error {
|
|
|
- fn from(err: async_native_tls::Error) -> Self {
|
|
|
- Self::AsyncNativeTlsError(err.to_string())
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
impl From<log::SetLoggerError> for Error {
|
|
|
fn from(err: log::SetLoggerError) -> Self {
|
|
|
Self::SetLoggerError(err.to_string())
|
|
|
@@ -491,6 +484,13 @@ impl From<tungstenite::Error> for Error {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+#[cfg(feature = "futures-rustls")]
|
|
|
+impl From<futures_rustls::rustls::client::InvalidDnsNameError> for Error {
|
|
|
+ fn from(err: futures_rustls::rustls::client::InvalidDnsNameError) -> Self {
|
|
|
+ Self::RustlsInvalidDns(err.to_string())
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
#[cfg(feature = "bincode")]
|
|
|
impl From<bincode::error::DecodeError> for Error {
|
|
|
fn from(err: bincode::error::DecodeError) -> Self {
|