diff --git a/Cargo.toml b/Cargo.toml index cd321bc..2814a33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "hyper-openssl" version = "0.10.0" authors = ["Steven Fackler "] -edition = "2018" +edition = "2021" description = "Hyper TLS support via OpenSSL" license = "MIT/Apache-2.0" repository = "https://github.com/sfackler/hyper-openssl" @@ -27,6 +27,7 @@ client-legacy = [ "hyper-util?/client-legacy", ] +tokio = ["hyper-util?/tokio"] [dependencies] http = { version = "1.0.0", optional = true } diff --git a/src/client/legacy.rs b/src/client/legacy.rs index 96a114d..fade8f1 100644 --- a/src/client/legacy.rs +++ b/src/client/legacy.rs @@ -4,7 +4,9 @@ use crate::SslStream; use http::uri::Scheme; use hyper::rt::{Read, ReadBufCursor, Write}; use hyper::Uri; -use hyper_util::client::legacy::connect::{Connected, Connection, HttpConnector}; +#[cfg(feature = "tokio")] +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::client::legacy::connect::{Connected, Connection}; use once_cell::sync::OnceCell; use openssl::error::ErrorStack; use openssl::ex_data::Index; @@ -115,6 +117,7 @@ pub struct HttpsConnector { inner: Inner, } +#[cfg(feature = "tokio")] impl HttpsConnector { /// Creates a new `HttpsConnector` using default settings. ///