fix(sdk): use bundled webpki roots for ICANN TLS instead of platform verifier - #430
Open
jvsena42 wants to merge 3 commits into
Open
fix(sdk): use bundled webpki roots for ICANN TLS instead of platform verifier#430jvsena42 wants to merge 3 commits into
jvsena42 wants to merge 3 commits into
Conversation
…verifier
The icann_http client was built with reqwest's default rustls config, which uses
rustls-platform-verifier. On targets where the verifier isn't initialized (e.g.
Android/iOS without the native component) the first standard-TLS request panics
('Expect rustls-platform-verifier to be initialized'), killing background tasks —
the auth-relay poller dies and surfaces as RequestExpired, so Pubky Ring sign-in
can never complete on mobile.
Pin bundled webpki roots with an explicit ring CryptoProvider for the ICANN client
(pubky-host TLS via pkarr's RawPublicKey verifier is unchanged). Works on every
platform with no native verifier component or process-default provider.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jvsena42
added a commit
to jvsena42/pubky-core-ffi-fork
that referenced
this pull request
Jun 13, 2026
…ANN TLS - route the pubky SDK's tracing events to Android logcat (init_logging + paranoid-android) so relay/TLS failures are diagnosable; install a panic hook that logs to the same sink (Rust panics otherwise vanish on Android) - install a process-wide ring CryptoProvider (defensive: both ring and aws-lc-rs are in the tree) - [patch.crates-io] pubky -> local pubky-core (fix/icann-webpki-roots) so the ICANN-TLS platform-verifier panic fix is in effect until it lands upstream (pubky/pubky-homeserver#430). Drop the patch once pubky 0.9.2 is released. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PubkyHttpClientbuilds itsicann_httpclient withreqwest::Client::builder()and no explicit TLS config, so reqwest defaults to rustls-platform-verifier. On targets where that verifier isn't initialized — notably Android and iOS without the native verifier component — the first standard-TLS request panics:Because the panic happens inside the background auth-relay polling task, the task is torn down, its channel sender drops, and the awaiting caller receives
AuthError::RequestExpired. The visible symptom: Pubky Ring sign-in never completes on mobile — Ring approves successfully, but the requesting app errors out ~500 ms afterstart_auth_flowwith "the provided auth request has expired or was cancelled", before approval even happens.This was diagnosed end-to-end against a real device/emulator: Ring reaches the relay (it uses the OS HTTP stack), but the SDK's
icann_httprequest tohttprelay.pubky.apppanics in the platform verifier.Fix
Build
icann_httpwith bundled webpki roots and an explicit ringCryptoProvider, viause_preconfigured_tls. This:ringandaws-lc-rsare in the tree);ClientBuilder::from(pkarr)), unchanged.Adds
rustls(ring) andwebpki-rootsto the non-wasm deps.Test
httprelay.pubky.appTLS succeeds, the relay poller stays alive, and a full Pubky Ring sign-in completes (token decrypted → session exchange → hydrated session). Without it, the verifier panic reproduces 100%.🤖 Generated with Claude Code