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(); + } }