diff --git a/Cargo.toml b/Cargo.toml index c87d7664..e05ee56e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,6 @@ ruma-api = "0.12.0" ruma-client-api = "0.5.0" ruma-events = "0.15.1" ruma-identifiers = "0.14.0" -native-tls = { version = "0.2.3", optional = true } serde = { version = "1.0.103", features = ["derive"] } serde_json = "1.0.44" serde_urlencoded = "0.6.1" @@ -34,4 +33,4 @@ tokio = { version = "0.2.4", features = ["macros"] } [features] default = ["tls"] -tls = ["hyper-tls", "native-tls"] +tls = ["hyper-tls"] diff --git a/src/lib.rs b/src/lib.rs index 816fb4c4..7e7d3fe2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,8 +100,6 @@ use hyper::{ }; #[cfg(feature = "hyper-tls")] use hyper_tls::HttpsConnector; -#[cfg(feature = "hyper-tls")] -use native_tls::Error as NativeTlsError; use ruma_api::{Endpoint, Outgoing}; use tokio::io::{AsyncRead, AsyncWrite}; use url::Url; @@ -165,14 +163,14 @@ pub type HttpsClient = Client>; #[cfg(feature = "tls")] impl HttpsClient { /// Creates a new client for making HTTPS requests to the given homeserver. - pub fn https(homeserver_url: Url, session: Option) -> Result { + pub fn https(homeserver_url: Url, session: Option) -> Self { let connector = HttpsConnector::new(); - Ok(Self(Arc::new(ClientData { + Self(Arc::new(ClientData { homeserver_url, hyper: HyperClient::builder().keep_alive(true).build(connector), session: Mutex::new(session), - }))) + })) } }