Skip to content

Commit 5876491

Browse files
authored
cli: Fix rustls crypto provider error (#2103)
2 parents d606aff + 870dd09 commit 5876491

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

svix-cli/Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

svix-cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ indoc = "2.0.5"
4646
open = "5.3.1"
4747
rand = "0.8.5"
4848
reqwest = { version = "0.12.9", features = ["rustls-tls", "json", "charset", "http2", "macos-system-configuration"], default-features = false }
49+
rustls = "0.23.34"
4950
serde = { version = "1.0.215", features = ["derive"] }
5051
serde_json = "1.0.133"
5152
svix = { path = "../rust" }

svix-cli/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ enum RootCommands {
9999
async fn main() -> Result<()> {
100100
let cli = Cli::parse();
101101
let color_mode = cli.color_mode();
102+
103+
// rustls requires a crypto backend ("provider") choice to be made explicitly
104+
// The Svix SDK uses the default provider if a default is not installed, but
105+
// we use reqwest directly in some code paths, which does not do this.
106+
_ = rustls::crypto::aws_lc_rs::default_provider().install_default();
107+
102108
// XXX: cfg can give an Err in certain situations.
103109
// Assigning the variable here since several match arms need a `&Config` but the rest of them
104110
// won't care/are still usable if the config doesn't exist.

0 commit comments

Comments
 (0)