From 7ff4f690a30923668d2dd4d13b8675ee78a5f725 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Fri, 12 Jun 2026 20:41:05 -0500 Subject: [PATCH] fix: add rustls provider for HTTPS tests - Add rustls dependency with aws_lc_rs feature to dev-dependencies - Initialize rustls provider in MCP transport tests - Fixes pre-existing test failures in mcp::transport::http module --- src-tauri/Cargo.toml | 1 + src-tauri/src/mcp/transport/http.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 484a24d0..00158b35 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -64,6 +64,7 @@ portable-pty = "0.8" [dev-dependencies] tokio-test = "0.4" mockito = "1.2" +rustls = { version = "0.23", features = ["aws_lc_rs"] } [profile.release] opt-level = "s" diff --git a/src-tauri/src/mcp/transport/http.rs b/src-tauri/src/mcp/transport/http.rs index 1d4a6e21..65d34b8b 100644 --- a/src-tauri/src/mcp/transport/http.rs +++ b/src-tauri/src/mcp/transport/http.rs @@ -260,6 +260,7 @@ mod tests { // Transport building tests (verify no panics with Tokio runtime) #[test] fn test_builds_transport_with_http() { + init_rustls_provider(); let rt = tokio::runtime::Runtime::new().unwrap(); let _guard = rt.enter(); let _transport = build_http_transport("http://localhost:8080", None, HashMap::new()); @@ -267,6 +268,7 @@ mod tests { #[test] fn test_builds_transport_with_https() { + init_rustls_provider(); let rt = tokio::runtime::Runtime::new().unwrap(); let _guard = rt.enter(); let _transport = build_http_transport("https://example.com/mcp", None, HashMap::new()); @@ -274,6 +276,7 @@ mod tests { #[test] fn test_builds_transport_with_auth() { + init_rustls_provider(); let rt = tokio::runtime::Runtime::new().unwrap(); let _guard = rt.enter(); let _transport = build_http_transport( @@ -282,4 +285,10 @@ mod tests { HashMap::new(), ); } + + #[cfg(test)] + fn init_rustls_provider() { + // Initialize rustls crypto provider for HTTPS tests + let _ = rustls::crypto::aws_lc_rs::default_provider().install_default(); + } }