Commit 2f683c0
rust: default to rustls TLS backend, add native-tls opt-in (#1805)
The Rust crate hard-coded the OpenSSL-backed native-tls stack for its
request-handler HTTP (reqwest `default-tls`) and WebSocket
(tokio-tungstenite `native-tls`) clients, pulling in `openssl-sys`. That
breaks `*-unknown-linux-musl` / fully-static builds (no OpenSSL sysroot)
and adds a dynamic `libssl` runtime dependency on glibc.
Make TLS feature-gated and default to rustls:
- `rustls-tls` (default): reqwest `rustls-tls-native-roots` +
tokio-tungstenite `rustls-tls-native-roots`, using rustls with the
`ring` provider and the OS trust store. OpenSSL-free, so musl/static
targets cross-compile with no system OpenSSL.
- `native-tls` (opt-in): keeps the platform-native stack for consumers
who want it.
The transport code is TLS-backend-agnostic (`reqwest::Client::builder()`
+ `connect_async`), so no source changes were needed. For `wss://`,
tokio-tungstenite resolves the rustls crypto provider via Cargo feature
unification on the shared `rustls` crate (reqwest pins `ring`).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 91eaa4b commit 2f683c0
3 files changed
Lines changed: 209 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
34 | 52 | | |
35 | 53 | | |
36 | 54 | | |
| |||
58 | 76 | | |
59 | 77 | | |
60 | 78 | | |
61 | | - | |
62 | | - | |
| 79 | + | |
| 80 | + | |
63 | 81 | | |
64 | 82 | | |
65 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
902 | 902 | | |
903 | 903 | | |
904 | 904 | | |
| 905 | + | |
| 906 | + | |
905 | 907 | | |
906 | 908 | | |
| 909 | + | |
| 910 | + | |
907 | 911 | | |
908 | 912 | | |
909 | 913 | | |
910 | 914 | | |
911 | | - | |
| 915 | + | |
912 | 916 | | |
913 | 917 | | |
914 | 918 | | |
915 | | - | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
916 | 924 | | |
917 | 925 | | |
918 | 926 | | |
| |||
0 commit comments