From 1f952402e9ce23b3cec3bf6b9b7708fadc30c352 Mon Sep 17 00:00:00 2001 From: Julien Enoch Date: Mon, 7 Dec 2020 11:56:15 +0100 Subject: [PATCH 1/6] Add 'h1-client-rustls' feature relying on rustls --- Cargo.toml | 4 +++- src/client.rs | 2 +- src/lib.rs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 42d9f77f..02e8a42d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ edition = "2018" default = ["curl-client", "middleware-logger", "encoding"] curl-client = ["http-client/curl_client", "once_cell", "default-client"] h1-client = ["http-client/h1_client", "default-client"] +h1-client-rustls = ["http-client/h1_client_rustls", "default-client"] hyper-client = ["http-client/hyper_client", "once_cell", "default-client", "async-std/tokio02"] wasm-client = ["http-client/wasm_client", "default-client"] default-client = [] @@ -35,7 +36,8 @@ log = { version = "0.4.7", features = ["kv_unstable"] } mime_guess = "2.0.3" serde = "1.0.97" serde_json = "1.0.40" -http-client = { version = "6.1.0", default-features = false } +# http-client = { version = "6.1.0", default-features = false } +http-client = { git = "https://github.com/http-rs/http-client.git", branch = "main", default-features = false } http-types = "2.5.0" async-std = { version = "1.6.0", default-features = false, features = ["std"] } async-trait = "0.1.36" diff --git a/src/client.rs b/src/client.rs index 2624aa1a..8dd82b2b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -12,7 +12,7 @@ cfg_if! { use http_client::isahc::IsahcClient as DefaultClient; } else if #[cfg(feature = "wasm-client")] { use http_client::wasm::WasmClient as DefaultClient; - } else if #[cfg(feature = "h1-client")] { + } else if #[cfg(any(feature = "h1-client", feature = "h1-client-rustls"))] { use http_client::h1::H1Client as DefaultClient; } else if #[cfg(feature = "hyper-client")] { use http_client::hyper::HyperClient as DefaultClient; diff --git a/src/lib.rs b/src/lib.rs index dc3505a2..dca774cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,7 +65,8 @@ //! The following features are available. The default features are //! `curl-client`, `middleware-logger`, and `encoding` //! - __`curl-client` (default):__ use `curl` (through `isahc`) as the HTTP backend. -//! - __`h1-client`:__ use `async-h1` as the HTTP backend. +//! - __`h1-client`:__ use `async-h1` as the HTTP backend with OpenSSL for HTTPS. +//! - __`h1-client-rustls`:__ use `async-h1` as the HTTP backend with `rustls` for HTTPS. //! - __`hyper-client`:__ use `hyper` (hyper.rs) as the HTTP backend. //! - __`wasm-client`:__ use `window.fetch` as the HTTP backend. //! - __`middleware-logger` (default):__ enables logging requests and responses using a middleware. From 23bf20f357e5913c8439e8b8448875df58b879ce Mon Sep 17 00:00:00 2001 From: Julien Enoch Date: Mon, 7 Dec 2020 12:10:08 +0100 Subject: [PATCH 2/6] Add test with h1-client-rustls feature in ci.yaml --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a081bd37..b4504afa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] rust: [nightly] - backend: [curl-client, h1-client, hyper-client] + backend: [curl-client, h1-client, hyper-client, h1-client-rustls] steps: - uses: actions/checkout@master From ec1fdc7e0026c19e5b752c2afadab447f294f124 Mon Sep 17 00:00:00 2001 From: Julien Enoch Date: Sat, 13 Feb 2021 14:50:39 +0100 Subject: [PATCH 3/6] CI: remove test of h1-client-rustls feature --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b4504afa..a081bd37 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] rust: [nightly] - backend: [curl-client, h1-client, hyper-client, h1-client-rustls] + backend: [curl-client, h1-client, hyper-client] steps: - uses: actions/checkout@master From 11e85a261d3400d31caf9a0af985ba9f61a45087 Mon Sep 17 00:00:00 2001 From: Julien Enoch Date: Sat, 13 Feb 2021 15:12:00 +0100 Subject: [PATCH 4/6] Bump http-client to 6.3.0, and expose new 'native-tls' and 'rustls' features --- .github/workflows/ci.yaml | 2 +- Cargo.toml | 6 +++--- src/lib.rs | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a081bd37..8bbc47ce 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] rust: [nightly] - backend: [curl-client, h1-client, hyper-client] + backend: [curl-client, 'h1-client native-tls', hyper-client] steps: - uses: actions/checkout@master diff --git a/Cargo.toml b/Cargo.toml index 02e8a42d..648164e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,9 +22,10 @@ edition = "2018" default = ["curl-client", "middleware-logger", "encoding"] curl-client = ["http-client/curl_client", "once_cell", "default-client"] h1-client = ["http-client/h1_client", "default-client"] -h1-client-rustls = ["http-client/h1_client_rustls", "default-client"] hyper-client = ["http-client/hyper_client", "once_cell", "default-client", "async-std/tokio02"] wasm-client = ["http-client/wasm_client", "default-client"] +native-tls = ["http-client/native-tls"] +rustls = ["http-client/rustls"] default-client = [] middleware-logger = [] # requires web-sys for TextDecoder on wasm @@ -36,8 +37,7 @@ log = { version = "0.4.7", features = ["kv_unstable"] } mime_guess = "2.0.3" serde = "1.0.97" serde_json = "1.0.40" -# http-client = { version = "6.1.0", default-features = false } -http-client = { git = "https://github.com/http-rs/http-client.git", branch = "main", default-features = false } +http-client = { version = "6.3.0", default-features = false } http-types = "2.5.0" async-std = { version = "1.6.0", default-features = false, features = ["std"] } async-trait = "0.1.36" diff --git a/src/lib.rs b/src/lib.rs index dca774cb..f8a32fa7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,10 +65,11 @@ //! The following features are available. The default features are //! `curl-client`, `middleware-logger`, and `encoding` //! - __`curl-client` (default):__ use `curl` (through `isahc`) as the HTTP backend. -//! - __`h1-client`:__ use `async-h1` as the HTTP backend with OpenSSL for HTTPS. -//! - __`h1-client-rustls`:__ use `async-h1` as the HTTP backend with `rustls` for HTTPS. +//! - __`h1-client`:__ use `async-h1` as the HTTP backend. For HTTPS, you also need either `native-tls` (to use OpenSSL) or either `rustls`. //! - __`hyper-client`:__ use `hyper` (hyper.rs) as the HTTP backend. //! - __`wasm-client`:__ use `window.fetch` as the HTTP backend. +//! - __`native-tls`:__ use OpenSSL for HTTPS (currently only usefull in addition of `h1-client`). +//! - __`rustls`:__ use rustls for HTTPS (currently only usefull in addition of `h1-client`). //! - __`middleware-logger` (default):__ enables logging requests and responses using a middleware. //! - __`encoding` (default):__ enables support for body encodings other than utf-8 From 4fa880519cf0d791779604ed8ba5d25196e393e7 Mon Sep 17 00:00:00 2001 From: Julien Enoch Date: Sat, 13 Feb 2021 15:31:31 +0100 Subject: [PATCH 5/6] Removed pending reference to 'h1-client-rustls' --- src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.rs b/src/client.rs index d9ea587e..5f450a59 100644 --- a/src/client.rs +++ b/src/client.rs @@ -12,7 +12,7 @@ cfg_if! { use http_client::isahc::IsahcClient as DefaultClient; } else if #[cfg(feature = "wasm-client")] { use http_client::wasm::WasmClient as DefaultClient; - } else if #[cfg(any(feature = "h1-client", feature = "h1-client-rustls"))] { + } else if #[cfg(feature = "h1-client")] { use http_client::h1::H1Client as DefaultClient; } else if #[cfg(feature = "hyper-client")] { use http_client::hyper::HyperClient as DefaultClient; From bf052821fa504fbd986087303d3d2bfefc222aee Mon Sep 17 00:00:00 2001 From: Julien Enoch Date: Tue, 16 Feb 2021 08:47:14 +0100 Subject: [PATCH 6/6] Bump http-client to 6.3.1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 648164e9..f86cdc2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ log = { version = "0.4.7", features = ["kv_unstable"] } mime_guess = "2.0.3" serde = "1.0.97" serde_json = "1.0.40" -http-client = { version = "6.3.0", default-features = false } +http-client = { version = "6.3.1", default-features = false } http-types = "2.5.0" async-std = { version = "1.6.0", default-features = false, features = ["std"] } async-trait = "0.1.36"