Skip to content

Commit b9e851d

Browse files
authored
fix(buzz-pair): install rustls ring CryptoProvider before WSS (#7998)
## Summary - `buzz-pair` panics on any `wss://` relay (including the documented default `wss://relay.damus.io`) because no rustls `CryptoProvider` is installed. `ws://` is unaffected. - Sibling binaries already install ring explicitly (`crates/buzz-cli/src/lib.rs`) and take a direct `rustls` dep with the `ring` feature so a unified release build can still select a provider. - This applies the same two-line pattern to `buzz-pairing-cli`: direct `rustls` dep (`ring` + `std`) and `install_default()` at the top of `main()`, before any connection. Fixes #7927. ## Test plan - [x] Diff matches the established `buzz-cli` install pattern (same dep features, same `let _ =` swallow on double-install). - [x] `cargo build -p buzz-pairing-cli` and `buzz-pair source --relay wss://relay.damus.io` reaches "Waiting for target" without the rustls panic. - [x] `buzz-pair test-vectors` still exits 0 (no WSS, install is a no-op). --------- Signed-off-by: Bartok9 <[email protected]>
1 parent 5ff83d8 commit b9e851d

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎Cargo.lock‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎crates/buzz-pairing-cli/Cargo.toml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ hex = { workspace = true }
2323
clap = { version = "4", features = ["derive", "env"] }
2424
thiserror = { workspace = true }
2525
zeroize = { workspace = true }
26+
27+
# Explicit rustls dep with ring provider — required to install the process-level
28+
# CryptoProvider at startup. Without this, `buzz-pair` panics on any `wss://`
29+
# relay (including the default `wss://relay.damus.io`) when a multi-package
30+
# release build unifies both ring and aws-lc-rs features. See crates/buzz-cli.
31+
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
32+

‎crates/buzz-pairing-cli/src/main.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ enum CliError {
9696

9797
#[tokio::main]
9898
async fn main() {
99+
// Install ring as the process-level rustls CryptoProvider before any WSS
100+
// connection. The documented default relay is `wss://relay.damus.io`, and a
101+
// multi-package release build unifies both ring and aws-lc-rs across the
102+
// workspace, so rustls cannot auto-select a provider. Without this,
103+
// `buzz-pair source` panics at rustls crypto/mod.rs after printing the QR.
104+
// The `let _ =` swallow is intentional: a second install returns Err.
105+
let _ = rustls::crypto::ring::default_provider().install_default();
106+
99107
let cli = Cli::parse();
100108
if let Err(e) = run(cli.command).await {
101109
eprintln!("error: {e}");

0 commit comments

Comments
 (0)