Skip to content

Commit 78fe3a1

Browse files
authored
Libs(Rust, CLI): switch from native-tls to rustls (#1590)
Using rustls simplifies some of the build/distribution concerns when packaging the CLI. Namely it allows us to produce binaries without having to ensure `openssl-sys` can build, and all that that involves. Oddly, while `native-tls` is listed as an optional-but-default dep in the Rust SDK, specifying the dep on the SDK from the CLI with `default-features = false` didn't seem to remove `openssl-sys` from the dependency tree. As a work around, I've updated the default features in the Rust SDK to target `rustls`, which does allow the sys crate to drop away. This seems fine to me. Folks who still want to use `native-tls` can elect to do so, just not by default. Some CLI features have been tuned up to support this effort, namely targeting specific individual features for `tokio`, and so on.
2 parents 5727802 + 47ad799 commit 78fe3a1

File tree

3 files changed

+146
-181
lines changed

3 files changed

+146
-181
lines changed

rust/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ keywords = ["svix", "webhooks", "diahook"]
1212
categories = ["development-tools", "asynchronous", "network-programming", "web-programming"]
1313

1414
[features]
15-
default = ["http1", "native-tls"]
15+
# openssl-sys keeps showing up in the CLI dep graph, breaking the build, even when
16+
# `default-features = false`.
17+
# Switcing the default to rustls properly culls it from the tree.
18+
default = ["http1", "rustls-tls"]
1619

1720
http1 = ["hyper-util/http1", "hyper-rustls?/http1"]
1821
http2 = ["hyper-util/http2", "hyper-rustls?/http2"]

0 commit comments

Comments
 (0)