Skip to content

Commit 71dcf61

Browse files
committed
test(cli): certify private CA websocket trust
Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
1 parent 5882061 commit 71dcf61

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

Cargo.lock

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

crates/buzz-cli/src/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,6 +2028,22 @@ async fn run(cli: Cli) -> Result<(), CliError> {
20282028
#[cfg(test)]
20292029
mod tests {
20302030
use super::*;
2031+
2032+
#[tokio::test]
2033+
#[ignore = "requires BUZZ_TEST_WSS_URL and network access"]
2034+
async fn configured_wss_trusts_native_platform_roots() {
2035+
let _ = rustls::crypto::ring::default_provider().install_default();
2036+
let url = std::env::var("BUZZ_TEST_WSS_URL")
2037+
.expect("BUZZ_TEST_WSS_URL must name the WSS endpoint to verify");
2038+
2039+
let connection = buzz_ws_client::NostrWsConnection::connect(&url)
2040+
.await
2041+
.expect("configured WSS endpoint should trust the platform certificate store");
2042+
connection
2043+
.disconnect()
2044+
.await
2045+
.expect("configured WSS endpoint should close cleanly");
2046+
}
20312047
use clap::CommandFactory;
20322048

20332049
/// Raw shorthand `[auth,hex,,hex]` normalizes to strict JSON; the empty

0 commit comments

Comments
 (0)