Skip to content

Drop the Android-only vendored OpenSSL - #718

Open
theosirian wants to merge 1 commit into
mainfrom
acc-2314-drop-the-vendored-openssl-from-android-builds-rustls-only-main
Open

theosirian wants to merge 1 commit into
mainfrom
acc-2314-drop-the-vendored-openssl-from-android-builds-rustls-only-main

Conversation

@theosirian

Copy link
Copy Markdown
Collaborator

Description

ssi-dids-core, did-ion, did-tz, did-web and ssi-vc have an Android-only reqwest
override with native-tls-vendored. These crates already use rustls; the override still
builds and links a full vendored OpenSSL 3.6 (QUIC included) into every Android app that depends
on ssi, and turns reqwest's default features back on. In SpruceKit Mobile, OpenSSL and the
second HTTP/TLS stack around it cost several MB of the Android .so.

History

The override came in with #120 (re-merged as #127, March 2021), when did-web and did-tezos
moved to reqwest 0.11 with default features: their default TLS was native-tls, and Android's
NDK has no OpenSSL to link, so it was vendored to make Android builds compile. #484 (November
2022, "Remove openssl") switched these crates to default-features = false + rustls-tls,
which removed the need, but left the Android-only blocks in place; they were later copied into
new crates and kept through the refactor (#508) and the reqwest upgrade (#702).

This removes the five override blocks. Manifest-only; no API change.

Behaviour on Android

With the override gone, Android uses the same reqwest 0.13 rustls backend as every other
platform: aws-lc-rs, with certificates checked by rustls-platform-verifier against the device
trust store. On Android, that verifier has to be initialised once with a JVM and an application
Context (rustls_platform_verifier::android::init_with_env, plus its Kotlin component) before
the first HTTPS request; otherwise that request panics. Apps that resolve did:web, did:tz or
did:ion, or fetch status lists, on Android need that step. SpruceKit Mobile adds it in its SDK
(an AndroidX Startup initializer).

Tested

cargo test --lib --tests -p ssi-dids-core -p did-ion -p did-tz -p did-web -p ssi-vc -p ssi-status:
80 passed, 0 failed.

Remove the `[target.'cfg(target_os = "android")'.dependencies.reqwest]`
overrides with `native-tls-vendored` from ssi-dids-core, did-ion,
did-tz,
did-web and ssi-vc. reqwest already uses rustls here, and the overrides
vendor a full OpenSSL (QUIC included) into every Android app that
depends on ssi.
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.

2 participants