From 8e03fa373e9c6cde6b570bc07194702134587b03 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 08 May 2026 18:21:15 +0000 Subject: [PATCH] refactor: init rustls in jrb binary instead --- --- a/Cargo.lock +++ b/Cargo.lock @@ -2392,6 +2392,7 @@ dependencies = [ "clap", "jrsonnet-pkg", + "rustls", "serde", "serde_json", "tracing", @@ -2578,7 +2579,6 @@ "gix", "peg", "reqwest", - "rustls", "serde", "serde_json", "thiserror", --- a/cmds/jrb/Cargo.toml +++ b/cmds/jrb/Cargo.toml @@ -18,3 +18,8 @@ serde_json.workspace = true tracing.workspace = true tracing-subscriber.workspace = true + +# jrsonnet-pkg wants a rustls provider. +# ring is not ideal and not recommended by rustls authors... But is easiest to build, +# and there should be little risk for bundling use case +rustls = { workspace = true, features = ["ring"] } --- a/cmds/jrb/src/main.rs +++ b/cmds/jrb/src/main.rs @@ -108,6 +108,10 @@ fn main() { tracing_subscriber::fmt().init(); + rustls::crypto::ring::default_provider() + .install_default() + .expect("install rustls crypto provider"); + let opts = Opts::parse(); match opts.command { --- a/crates/jrsonnet-pkg/Cargo.toml +++ b/crates/jrsonnet-pkg/Cargo.toml @@ -26,9 +26,5 @@ url.workspace = true camino.workspace = true -# ring is not ideal and not recommended by rustls authors... But is easiest to build, -# and there should be little risk for bundling use case -rustls = { workspace = true, features = ["ring"] } - # Global cache dir directories.workspace = true -- gitstuff