Skip to content

Commit c06c66d

Browse files
committed
build: add native-tls integration
1 parent aed4e6b commit c06c66d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

eventsource-client/Cargo.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ exclude = ["CHANGELOG.md"]
1313
futures = "0.3.21"
1414
hyper = { version = "0.14.19", features = ["client", "http1", "tcp"] }
1515
hyper-rustls = { version = "0.24.1", optional = true }
16+
hyper-tls = { version = "0.5", optional = true }
1617
log = "0.4.6"
1718
pin-project = "1.0.10"
1819
tokio = { version = "1.17.0", features = ["time"] }
@@ -27,11 +28,7 @@ tokio = { version = "1.2.0", features = ["macros", "rt-multi-thread"] }
2728
test-case = "3.2.1"
2829
proptest = "1.0.0"
2930

30-
3131
[features]
3232
default = ["rustls"]
3333
rustls = ["hyper-rustls", "hyper-rustls/http2"]
34-
35-
[[example]]
36-
name = "tail"
37-
required-features = ["rustls"]
34+
native-tls = ["hyper-tls"]

eventsource-client/examples/tail.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ async fn main() -> Result<(), es::Error> {
2626
.backoff_factor(2)
2727
.delay_max(Duration::from_secs(60))
2828
.build(),
29-
)
30-
.build();
29+
);
30+
#[cfg(feature = "rustls")]
31+
let client = client.build();
32+
33+
#[cfg(feature = "native-tls")]
34+
let client = client.build_http();
3135

3236
let mut stream = tail_events(client);
3337

0 commit comments

Comments
 (0)