Skip to content

fix: install ring as the default rustls provider (#61) - #63

Closed
vb1704 wants to merge 1 commit into
unomed-dev:mainfrom
vb1704:fix/install-ring-provider
Closed

vb1704 wants to merge 1 commit into
unomed-dev:mainfrom
vb1704:fix/install-ring-provider

Conversation

@vb1704

@vb1704 vb1704 commented Sep 30, 2026

Copy link
Copy Markdown

Fixes #61.

patches/matrix-rust-sdk-ring-provider.patch switches matrix-sdk's reqwest to rustls-no-provider, which stops reqwest from installing a crypto provider. Nothing else installs one, so since 0.10.1 every HTTP request fails with "No provider set" and restoreSession can't complete.

This adds one hunk to that patch: HttpSettings::make_client installs ring as the process-wide default before building the reqwest client:

let _ = rustls::crypto::ring::default_provider().install_default();
  • It runs before any request, and before the Android-only rustls::ClientConfig::builder() in android_setup_webkpi_verifier, which also needs a default provider.
  • install_default returns an error only when a provider is already installed (for example if an app installs its own), so ignoring it is safe and keeps the call idempotent.
  • rustls with the ring feature is already a non-wasm dependency added by the same patch, so no Cargo changes are needed.

The rest of the patch is unchanged; the regenerated file applies cleanly with git apply --check to matrix-rust-sdk at 1c44fb66 (matrix-sdk-0.18.0).

Testing: I haven't built the bindings locally (no Rust toolchain on this machine), so this needs a CI or local build to confirm. For context, we hit both issues on Android (React Native 0.84, Android 16): 0.10.0 crashes in aws-lc's jitter entropy on the first TLS handshake, and 0.10.1 fails with "No provider set".

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" (unomed-dev#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.
@vb1704

vb1704 commented Sep 30, 2026

Copy link
Copy Markdown
Author

Closing as a duplicate of #62, which makes the same change and was opened first; sorry for missing it. We're building #62's branch for Android now and will report the result there (React Native 0.84, Android 16).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.10.1: every HTTP request fails with "No provider set" (ring patch installs no rustls CryptoProvider)

1 participant