tls: default to Arti's rustls backend (drop OpenSSL from TLS)
All checks were successful
ci / test (pull_request) Successful in 6m47s
android-ci / android (pull_request) Successful in 8m21s
ci / sdk (pull_request) Successful in 1m25s

Arti's TLS backends are non-additive; the root crate defaulted to
`native-tls` (OpenSSL). Switch `default = ["rustls"]` and pin the `rustls`
crate with its `ring` feature — `tor-rtcompat` pulls rustls in with
`default-features = false`, so without that pin the backend compiles with no
`CryptoProvider` and the first TLS config fails (same reason already recorded
in crates/onionwire-sdk/Cargo.toml).

`native-tls` stays as an opt-in feature. SQLCipher still builds vendored
OpenSSL (`bundled-sqlcipher-vendored-openssl`); that is unrelated to TLS.

- tests/tls_backend.rs: compile-time pin that the default features select
  rustls, plus a runtime check that rustls resolves a provider with no manual
  install.
- ci.yml: the root `test` job no longer installs pkg-config/libssl-dev (the
  SDK job keeps it).
- docs: README build deps, ARTI_UPGRADE backend table, release-body and the
  SDK README now describe the rustls default; the false "binaries link
  libssl.so.3 dynamically" claim is corrected.
- crates/onionwire-sdk/Cargo.lock: regenerated for the root crate's new
  dependency (separate workspace, --locked would otherwise fail).
This commit is contained in:
Hermes rust-dev 2026-09-17 20:48:05 -04:00
commit 69672809ab
No known key found for this signature in database
10 changed files with 91 additions and 38 deletions

View file

@ -39,9 +39,9 @@ env:
CARGO_REGISTRY_VOLUME: onionwire-cargo-registry
CARGO_TARGET_VOLUME: onionwire-target-ci
BUILD_CONTAINER: onionwire-ci-${{ github.run_id }}
# The SDK job gets its own target volume: it resolves the root crate with
# `rustls` instead of `native-tls`, so sharing a target dir would thrash both
# jobs' feature-unified artifacts.
# The SDK job gets its own target volume: `crates/onionwire-sdk` is a
# separate cargo workspace with its own lockfile and its own crate set, so
# sharing a target dir with the root job would thrash both.
SDK_CARGO_TARGET_VOLUME: onionwire-target-ci-sdk
SDK_BUILD_CONTAINER: onionwire-ci-sdk-${{ github.run_id }}
@ -70,8 +70,6 @@ jobs:
-w /src \
"$RUST_IMAGE" \
sh -euxc 'mkdir -p /src && tar xzf - -C /src && cd /src \
&& apt-get update \
&& apt-get install -y --no-install-recommends pkg-config libssl-dev \
&& rustup component add clippy \
&& cargo test --locked \
&& cargo clippy --locked --all-targets -- -D warnings'
@ -80,12 +78,19 @@ jobs:
docker rm -f "$BUILD_CONTAINER" > /dev/null
# `crates/onionwire-sdk` is a SEPARATE cargo workspace: its own Cargo.lock and
# a path dependency on the root crate, resolved with `rustls` instead of
# `native-tls`. The `test` job above therefore never compiles it, so a
# root-crate signature change (`Node::send` gaining the outbox result, the
# SQLCipher passphrase entry points) breaks the Android SDK — and the tagged
# release AAR, since android-release.yml only builds on `v*.*.*` — while both
# the root suites and local `cargo test` stay green. Build it here.
# a path dependency on the root crate. The `test` job above therefore never
# compiles it, so a root-crate signature change (`Node::send` gaining the
# outbox result, the SQLCipher passphrase entry points) breaks the Android SDK
# — and the tagged release AAR, since android-release.yml only builds on
# `v*.*.*` — while both the root suites and local `cargo test` stay green.
# Build it here.
#
# The root `test` job no longer installs `pkg-config`/`libssl-dev` — the root
# crate defaults to Arti's rustls backend, so TLS needs no system OpenSSL.
# The `rusqlite` `bundled-sqlcipher-vendored-openssl` feature that both jobs
# use compiles OpenSSL from source, which needs `perl` and `make` (present in
# the `rust:*-bookworm` image), not the `-dev` headers. This job keeps the
# install: the Android SDK build is unchanged by the root crate's TLS default.
sdk:
runs-on: docker
timeout-minutes: 120