From 0510ffc0eae2377ab1e265f4c2f88ae021d338f6 Mon Sep 17 00:00:00 2001 From: Vaibhav Bhalodia <47853062+vb1704@users.noreply.github.com> Date: Wed, 30 Sep 2026 11:50:59 +0530 Subject: [PATCH] fix: install ring as the default rustls provider The ring patch switches matrix-sdk's reqwest to rustls-no-provider, which no longer installs a crypto provider. Nothing else installs one, so every HTTP request fails with "No provider set" (#61). Install ring as the process-wide default at the start of HttpSettings::make_client, before reqwest (and, on Android, the custom rustls ClientConfig) needs it. install_default only errors when a provider is already installed, so the result is ignored. --- patches/matrix-rust-sdk-ring-provider.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/patches/matrix-rust-sdk-ring-provider.patch b/patches/matrix-rust-sdk-ring-provider.patch index e73faab..bf920f6 100644 --- a/patches/matrix-rust-sdk-ring-provider.patch +++ b/patches/matrix-rust-sdk-ring-provider.patch @@ -29,3 +29,19 @@ index fe4e3da..dd66fd3 100644 rustls-pki-types = "1.14.0" rustls-native-certs = "0.8.3" webpki-roots = "1.0.6" +diff --git a/crates/matrix-sdk/src/http_client/native.rs b/crates/matrix-sdk/src/http_client/native.rs +index a02455f..da21e75 100644 +--- a/crates/matrix-sdk/src/http_client/native.rs ++++ b/crates/matrix-sdk/src/http_client/native.rs +@@ -185,6 +185,11 @@ impl Default for HttpSettings { + impl HttpSettings { + /// Build a client with the specified configuration. + pub(crate) fn make_client(&self) -> Result { ++ // reqwest's `rustls-no-provider` feature leaves the process-wide rustls ++ // provider unset, so every request would fail with "No provider set". ++ // Install ring once; an error only means a provider is already installed. ++ let _ = rustls::crypto::ring::default_provider().install_default(); ++ + let user_agent = self.user_agent.clone().unwrap_or_else(|| "matrix-rust-sdk".to_owned()); + let mut http_client = reqwest::Client::builder() + .user_agent(user_agent)