Skip to content

Commit

Permalink
Libs(Rust, CLI): switch from native-tls to rustls (#1590)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
svix-onelson authored Dec 26, 2024
2 parents 5727802 + 47ad799 commit 78fe3a1
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 181 deletions.
5 changes: 4 additions & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ keywords = ["svix", "webhooks", "diahook"]
categories = ["development-tools", "asynchronous", "network-programming", "web-programming"]

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

http1 = ["hyper-util/http1", "hyper-rustls?/http1"]
http2 = ["hyper-util/http2", "hyper-rustls?/http2"]
Expand Down
Loading

0 comments on commit 78fe3a1

Please sign in to comment.