Skip to content

Commit 5a5621b

Browse files
authored
Merge pull request #292 from Fishrock123/h1-client-rustls
Add 'h1-client-rustls' feature relying on rustls
2 parents f8d02c3 + 1adb821 commit 5a5621b

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
matrix:
2020
os: [ubuntu-latest, windows-latest, macOS-latest]
2121
rust: [nightly]
22-
backend: [curl-client, h1-client, hyper-client]
22+
backend: [curl-client, h1-client, h1-client-rustls, hyper-client]
2323

2424
steps:
2525
- uses: actions/checkout@master

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ edition = "2018"
2222
default = ["curl-client", "middleware-logger", "encoding"]
2323
curl-client = ["http-client/curl_client", "once_cell", "default-client"]
2424
h1-client = ["http-client/h1_client", "http-client/native-tls", "default-client"]
25+
h1-client-rustls = ["http-client/h1_client", "http-client/rustls", "default-client"]
2526
hyper-client = ["http-client/hyper_client", "once_cell", "default-client", "async-std/tokio02"]
2627
wasm-client = ["http-client/wasm_client", "default-client"]
2728
default-client = []
@@ -35,7 +36,7 @@ log = { version = "0.4.7", features = ["kv_unstable"] }
3536
mime_guess = "2.0.3"
3637
serde = "1.0.97"
3738
serde_json = "1.0.40"
38-
http-client = { version = "6.3.0", default-features = false }
39+
http-client = { version = "6.3.1", default-features = false }
3940
http-types = "2.5.0"
4041
async-std = { version = "1.6.0", default-features = false, features = ["std"] }
4142
async-trait = "0.1.36"

src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cfg_if! {
1212
use http_client::isahc::IsahcClient as DefaultClient;
1313
} else if #[cfg(feature = "wasm-client")] {
1414
use http_client::wasm::WasmClient as DefaultClient;
15-
} else if #[cfg(feature = "h1-client")] {
15+
} else if #[cfg(any(feature = "h1-client", feature = "h1-client-rustls"))] {
1616
use http_client::h1::H1Client as DefaultClient;
1717
} else if #[cfg(feature = "hyper-client")] {
1818
use http_client::hyper::HyperClient as DefaultClient;

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
//! The following features are available. The default features are
6666
//! `curl-client`, `middleware-logger`, and `encoding`
6767
//! - __`curl-client` (default):__ use `curl` (through `isahc`) as the HTTP backend.
68-
//! - __`h1-client`:__ use `async-h1` as the HTTP backend.
68+
//! - __`h1-client`:__ use `async-h1` as the HTTP backend with native TLS for HTTPS.
69+
//! - __`h1-client-rustls`:__ use `async-h1` as the HTTP backend with `rustls` for HTTPS.
6970
//! - __`hyper-client`:__ use `hyper` (hyper.rs) as the HTTP backend.
7071
//! - __`wasm-client`:__ use `window.fetch` as the HTTP backend.
7172
//! - __`middleware-logger` (default):__ enables logging requests and responses using a middleware.

0 commit comments

Comments
 (0)