diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 813b99e3442..fed22a53186 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: - no-encryption-and-sqlite - sqlite-cryptostore - experimental-encrypted-state-events - - rustls-tls + - native-tls - markdown - socks - sso-login diff --git a/Cargo.lock b/Cargo.lock index 330ac669976..bb514158906 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,7 +190,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "rustc-hash 2.0.0", + "rustc-hash", "serde", "serde_derive", "syn 2.0.101", @@ -655,10 +655,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.22" +version = "1.2.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +checksum = "cd4932aefd12402b36c60956a4fe0035421f544799057659ff86f923657aada3" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -670,6 +671,12 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f4c707c6a209cbe82d10abd08e1ea8995e9ea937d2550646e02798948992be0" +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "1.0.4" @@ -896,6 +903,16 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "compact_str" version = "0.8.1" @@ -968,6 +985,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -1806,6 +1833,12 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +[[package]] +name = "find-msvc-tools" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f449e6c6c08c865631d4890cfacf252b3d396c9bcc83adb6623cdb02a8336c41" + [[package]] name = "findshlibs" version = "0.10.2" @@ -2030,20 +2063,22 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "r-efi", + "wasip2", + "wasm-bindgen", ] [[package]] @@ -2766,6 +2801,22 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.63", + "walkdir", + "windows-sys 0.45.0", +] + [[package]] name = "jni-sys" version = "0.3.0" @@ -2783,9 +2834,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.82" +version = "0.3.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" dependencies = [ "once_cell", "wasm-bindgen", @@ -2960,6 +3011,12 @@ dependencies = [ "hashbrown 0.14.5", ] +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "lz4_flex" version = "0.11.5" @@ -3106,6 +3163,7 @@ dependencies = [ "bytes", "bytesize", "cfg-if", + "ctor", "dirs", "event-listener", "eyeball", @@ -3133,12 +3191,16 @@ dependencies = [ "mime", "mime2ext", "oauth2", + "oauth2-reqwest", "percent-encoding", "pin-project-lite", "proptest", "rand 0.8.5", - "reqwest", + "reqwest 0.13.2", + "ring", "ruma", + "rustls", + "rustls-pki-types", "serde", "serde_html_form", "serde_json", @@ -3214,7 +3276,7 @@ dependencies = [ "futures-core", "futures-executor", "futures-util", - "getrandom 0.2.15", + "getrandom 0.3.4", "gloo-timers", "imbl", "insta", @@ -3378,7 +3440,7 @@ dependencies = [ "async-trait", "base64", "futures-util", - "getrandom 0.2.15", + "getrandom 0.3.4", "gloo-timers", "gloo-utils", "growable-bloom-filter", @@ -3430,7 +3492,7 @@ dependencies = [ "matrix-sdk-test-utils", "matrix-sdk-ui", "rand 0.8.5", - "reqwest", + "reqwest 0.13.2", "serde_json", "similar-asserts", "stream_assert", @@ -3514,7 +3576,7 @@ dependencies = [ "base64", "blake3", "chacha20poly1305", - "getrandom 0.2.15", + "getrandom 0.3.4", "hmac", "pbkdf2", "rand 0.8.5", @@ -3532,7 +3594,7 @@ version = "0.16.0" dependencies = [ "as_variant", "ctor", - "getrandom 0.2.15", + "getrandom 0.3.4", "http", "insta", "matrix-sdk-common", @@ -3689,9 +3751,9 @@ checksum = "cbf6f36070878c42c5233846cd3de24cf9016828fd47bc22957a687298bb21fc" [[package]] name = "minicov" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b" +checksum = "4869b6a491569605d66d3952bcdf03df789e5b536e5f0cf7758a7f08a55ae24d" dependencies = [ "cc", "walkdir", @@ -3722,7 +3784,7 @@ dependencies = [ "hermit-abi 0.3.9", "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.52.0", ] @@ -3781,10 +3843,10 @@ dependencies = [ "libc", "log", "openssl", - "openssl-probe", + "openssl-probe 0.1.5", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] @@ -3881,7 +3943,6 @@ dependencies = [ "getrandom 0.2.15", "http", "rand 0.8.5", - "reqwest", "serde", "serde_json", "serde_path_to_error", @@ -3890,6 +3951,16 @@ dependencies = [ "url", ] +[[package]] +name = "oauth2-reqwest" +version = "0.1.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234fb5c965bbce983ee5de636a7a51d6a3223da8067ea02f9ab2d2d78ac08be2" +dependencies = [ + "oauth2", + "reqwest 0.13.2", +] + [[package]] name = "object" version = "0.37.3" @@ -3913,9 +3984,9 @@ checksum = "269bca4c2591a28585d6bf10d9ed0332b7d76900a1b02bec41bdc3a2cdcda107" [[package]] name = "oorandom" -version = "11.1.4" +version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "opaque-debug" @@ -3955,6 +4026,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-probe" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391" + [[package]] name = "openssl-sys" version = "0.9.108" @@ -4315,15 +4392,14 @@ dependencies = [ [[package]] name = "proptest" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" +checksum = "bee689443a2bd0a16ab0348b52ee43e3b2d1b1f931c8aa5c9f8de4c86fbe8c40" dependencies = [ "bitflags", - "lazy_static", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.2", + "rand_chacha 0.9.0", "rand_xorshift", "regex-syntax", "unarray", @@ -4390,36 +4466,43 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ "bytes", + "cfg_aliases", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 1.1.0", + "rustc-hash", "rustls", - "thiserror 1.0.63", + "socket2 0.6.0", + "thiserror 2.0.17", "tokio", "tracing", + "web-time", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ "bytes", - "rand 0.8.5", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.2", "ring", - "rustc-hash 2.0.0", + "rustc-hash", "rustls", + "rustls-pki-types", "slab", - "thiserror 1.0.63", + "thiserror 2.0.17", "tinyvec", "tracing", + "web-time", ] [[package]] @@ -4431,6 +4514,7 @@ dependencies = [ "libc", "once_cell", "socket2 0.5.7", + "tracing", "windows-sys 0.52.0", ] @@ -4443,6 +4527,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rand" version = "0.8.5" @@ -4499,7 +4589,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.4", ] [[package]] @@ -4514,11 +4604,11 @@ dependencies = [ [[package]] name = "rand_xorshift" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" dependencies = [ - "rand_core 0.6.4", + "rand_core 0.9.3", ] [[package]] @@ -4641,13 +4731,11 @@ version = "0.12.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" dependencies = [ - "async-compression", "base64", "bytes", "futures-channel", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", @@ -4670,6 +4758,46 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 1.0.2", +] + +[[package]] +name = "reqwest" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "js-sys", + "log", + "native-tls", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tokio-rustls", "tokio-util", "tower", "tower-http", @@ -4679,7 +4807,6 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 1.0.2", ] [[package]] @@ -4942,12 +5069,6 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.0.0" @@ -4991,9 +5112,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.27" +version = "0.23.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" +checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" dependencies = [ "log", "once_cell", @@ -5004,6 +5125,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe 0.2.0", + "rustls-pki-types", + "schannel", + "security-framework 3.5.1", +] + [[package]] name = "rustls-pemfile" version = "2.1.2" @@ -5016,18 +5149,46 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ + "web-time", "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework 3.5.1", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" -version = "0.103.3" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "ring", "rustls-pki-types", @@ -5114,7 +5275,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -5122,9 +5296,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -5148,7 +5322,7 @@ checksum = "d9794f69ad475e76c057e326175d3088509649e3aed98473106b9fe94ba59424" dependencies = [ "httpdate", "native-tls", - "reqwest", + "reqwest 0.12.24", "rustls", "sentry-backtrace", "sentry-contexts", @@ -5716,7 +5890,7 @@ dependencies = [ "rayon", "regex", "rust-stemmers", - "rustc-hash 2.0.0", + "rustc-hash", "serde", "serde_json", "sketches-ddsketch", @@ -5836,7 +6010,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.4", "once_cell", "rustix 1.0.8", "windows-sys 0.61.2", @@ -6150,17 +6324,22 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ + "async-compression", "bitflags", "bytes", + "futures-core", "futures-util", "http", "http-body", + "http-body-util", "iri-string", "pin-project-lite", + "tokio", + "tokio-util", "tower", "tower-layer", "tower-service", @@ -6651,7 +6830,7 @@ version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.4", "js-sys", "serde", "wasm-bindgen", @@ -6769,19 +6948,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasi" -version = "0.13.3+wasi-0.2.2" +name = "wasip2" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ - "wit-bindgen-rt", + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.105" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" dependencies = [ "cfg-if", "once_cell", @@ -6792,11 +6971,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.55" +version = "0.4.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551f88106c6d5e7ccc7cd9a16f312dd3b5d36ea8b4954304657d5dfba115d4a0" +checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" dependencies = [ "cfg-if", + "futures-util", "js-sys", "once_cell", "wasm-bindgen", @@ -6805,9 +6985,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.105" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6815,9 +6995,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.105" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" dependencies = [ "bumpalo", "proc-macro2", @@ -6828,42 +7008,57 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.105" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" dependencies = [ "unicode-ident", ] [[package]] name = "wasm-bindgen-test" -version = "0.3.55" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfc379bfb624eb59050b509c13e77b4eb53150c350db69628141abce842f2373" +checksum = "6311c867385cc7d5602463b31825d454d0837a3aba7cdb5e56d5201792a3f7fe" dependencies = [ + "async-trait", + "cast", "js-sys", + "libm", "minicov", + "nu-ansi-term", + "num-traits", + "oorandom", + "serde", + "serde_json", "wasm-bindgen", "wasm-bindgen-futures", "wasm-bindgen-test-macro", + "wasm-bindgen-test-shared", ] [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.55" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "085b2df989e1e6f9620c1311df6c996e83fe16f57792b272ce1e024ac16a90f1" +checksum = "67008cdde4769831958536b0f11b3bdd0380bde882be17fff9c2f34bb4549abd" dependencies = [ "proc-macro2", "quote", "syn 2.0.101", ] +[[package]] +name = "wasm-bindgen-test-shared" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe29135b180b72b04c74aa97b2b4a2ef275161eff9a6c7955ea9eaedc7e1d4e" + [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" dependencies = [ "futures-util", "js-sys", @@ -6892,9 +7087,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.82" +version = "0.3.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1" +checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" dependencies = [ "js-sys", "wasm-bindgen", @@ -7113,6 +7308,15 @@ dependencies = [ "windows-link 0.1.1", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -7149,6 +7353,21 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -7189,6 +7408,12 @@ dependencies = [ "windows-link 0.1.1", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -7201,6 +7426,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -7213,6 +7444,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -7231,6 +7468,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -7243,6 +7486,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -7255,6 +7504,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -7267,6 +7522,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -7321,13 +7582,10 @@ dependencies = [ ] [[package]] -name = "wit-bindgen-rt" -version = "0.33.0" +name = "wit-bindgen" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" -dependencies = [ - "bitflags", -] +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" [[package]] name = "write16" diff --git a/Cargo.toml b/Cargo.toml index 52b5c62d781..1dd2d2c883b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ eyeball-im-util = { version = "0.10.0", default-features = false } futures-core = { version = "0.3.31", default-features = false, features = ["std"] } futures-executor = { version = "0.3.31", default-features = false, features = ["std"] } futures-util = { version = "0.3.31", default-features = false, features = ["std"] } -getrandom = { version = "0.2.15", default-features = false } +getrandom = { version = "0.3.4", default-features = false } gloo-timers = { version = "0.3.0", default-features = false } gloo-utils = { version = "0.2.0", default-features = false, features = ["serde"] } growable-bloom-filter = { version = "2.1.1", default-features = false } @@ -60,15 +60,17 @@ insta = { version = "1.44.1", features = ["json", "redactions"] } itertools = { version = "0.14.0", default-features = false, features = ["use_std"] } js-sys = { version = "0.3.82", default-features = false, features = ["std"] } mime = { version = "0.3.17", default-features = false } -oauth2 = { version = "5.0.0", default-features = false, features = ["reqwest", "timing-resistant-secret-traits"] } +oauth2 = { version = "5.0.0", default-features = false, features = ["timing-resistant-secret-traits"] } +oauth2-reqwest = { version = "0.1.0-alpha.3", default-features = false } pbkdf2 = { version = "0.12.2", default-features = false } pin-project-lite = { version = "0.2.16", default-features = false } proc-macro2 = { version = "1.0.106", default-features = false } -proptest = { version = "1.6.0", default-features = false, features = ["std"] } +proptest = { version = "1.9.0", default-features = false, features = ["std"] } quote = { version = "1.0.37", default-features = false } rand = { version = "0.8.5", default-features = false, features = ["std", "std_rng"] } regex = { version = "1.12.2", default-features = false } -reqwest = { version = "0.12.24", default-features = false } +reqwest = { version = "0.13.1", default-features = false } +ring = { version = "0.17.14", default-features = false } rmp-serde = { version = "1.3.0", default-features = false } ruma = { git = "https://github.com/ruma/ruma", rev = "4a0ae80fbf42d1b759e108d7315537d13583c144", features = [ "client-api-c", @@ -93,6 +95,8 @@ ruma = { git = "https://github.com/ruma/ruma", rev = "4a0ae80fbf42d1b759e108d731 "unstable-msc4308", "unstable-msc4310", ] } +rustls = { version = "0.23.37", default-features = false, features = ["ring"] } +rustls-pki-types = { version = "1.14.0", default-features = false } sentry = { version = "0.46.0", default-features = false } sentry-tracing = { version = "0.46.0", default-features = false } serde = { version = "1.0.228", default-features = false, features = ["std", "rc", "derive"] } diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index d40cb1dc051..cc8f540adb1 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -17,7 +17,7 @@ codspeed = [] assert_matches.workspace = true criterion = { version = "4.2.1", features = ["async", "async_tokio", "html_reports"], package = "codspeed-criterion-compat" } futures-util.workspace = true -matrix-sdk = { workspace = true, features = ["native-tls", "e2e-encryption", "sqlite", "testing"] } +matrix-sdk = { workspace = true, features = ["rustls-tls", "e2e-encryption", "sqlite", "testing"] } matrix-sdk-base.workspace = true matrix-sdk-crypto.workspace = true matrix-sdk-sqlite = { workspace = true, features = ["crypto-store"] } diff --git a/bindings/matrix-sdk-ffi/Cargo.toml b/bindings/matrix-sdk-ffi/Cargo.toml index 194f86f1875..338f2713357 100644 --- a/bindings/matrix-sdk-ffi/Cargo.toml +++ b/bindings/matrix-sdk-ffi/Cargo.toml @@ -24,7 +24,7 @@ crate-type = [ ] [features] -default = ["bundled-sqlite", "unstable-msc4274", "experimental-element-recent-emojis", "native-tls"] +default = ["bundled-sqlite", "unstable-msc4274", "experimental-element-recent-emojis", "rustls-tls"] # Use SQLite for the session storage. sqlite = ["matrix-sdk/sqlite"] # Use an embedded version of SQLite. diff --git a/crates/matrix-sdk-common/Cargo.toml b/crates/matrix-sdk-common/Cargo.toml index 42ca1dbb6b1..a105ad9ea5e 100644 --- a/crates/matrix-sdk-common/Cargo.toml +++ b/crates/matrix-sdk-common/Cargo.toml @@ -65,7 +65,7 @@ wasm-bindgen-test.workspace = true [target.'cfg(target_family = "wasm")'.dev-dependencies] # Enable the JS feature for getrandom. -getrandom = { workspace = true, default-features = false, features = ["js"] } +getrandom = { workspace = true, default-features = false, features = ["wasm_js"] } js-sys.workspace = true [lints] diff --git a/crates/matrix-sdk-indexeddb/Cargo.toml b/crates/matrix-sdk-indexeddb/Cargo.toml index b6a19d3b3d7..b5900e6fef4 100644 --- a/crates/matrix-sdk-indexeddb/Cargo.toml +++ b/crates/matrix-sdk-indexeddb/Cargo.toml @@ -60,7 +60,7 @@ zeroize.workspace = true [target.'cfg(target_family = "wasm")'.dependencies] # for wasm32 we need to activate this -getrandom = { workspace = true, features = ["js"] } +getrandom = { workspace = true, features = ["wasm_js"] } [dev-dependencies] assert_matches.workspace = true diff --git a/crates/matrix-sdk-store-encryption/Cargo.toml b/crates/matrix-sdk-store-encryption/Cargo.toml index 6fa9cdbedb1..3235733383c 100644 --- a/crates/matrix-sdk-store-encryption/Cargo.toml +++ b/crates/matrix-sdk-store-encryption/Cargo.toml @@ -14,7 +14,7 @@ rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] ignored = ["getrandom"] # We do manually enable a feature for it. [features] -js = ["dep:getrandom", "getrandom?/js"] +js = ["dep:getrandom", "getrandom?/wasm_js"] [dependencies] base64.workspace = true diff --git a/crates/matrix-sdk-ui/Cargo.toml b/crates/matrix-sdk-ui/Cargo.toml index a4b8dc70116..8419100a263 100644 --- a/crates/matrix-sdk-ui/Cargo.toml +++ b/crates/matrix-sdk-ui/Cargo.toml @@ -11,7 +11,7 @@ rust-version.workspace = true rustdoc-args = ["--generate-link-to-definition"] [features] -default = ["native-tls"] +default = ["rustls-tls"] native-tls = ["matrix-sdk/native-tls"] rustls-tls = ["matrix-sdk/rustls-tls"] diff --git a/crates/matrix-sdk/Cargo.toml b/crates/matrix-sdk/Cargo.toml index 343b8f0ff48..508d8f1e0a8 100644 --- a/crates/matrix-sdk/Cargo.toml +++ b/crates/matrix-sdk/Cargo.toml @@ -15,8 +15,11 @@ version = "0.16.0" features = ["docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] +[package.metadata.cargo-machete] +ignored = ["ring", "rustls-pki-types"] + [features] -default = ["e2e-encryption", "automatic-room-key-forwarding", "sqlite", "native-tls"] +default = ["e2e-encryption", "automatic-room-key-forwarding", "sqlite", "rustls-tls"] testing = [ "matrix-sdk-sqlite?/testing", "matrix-sdk-indexeddb?/testing", @@ -33,7 +36,12 @@ e2e-encryption = [ # activate on indexeddb if given "matrix-sdk-indexeddb?/e2e-encryption", ] -js = ["matrix-sdk-common/js", "matrix-sdk-base/js"] +js = [ + "matrix-sdk-common/js", + "matrix-sdk-base/js", + "rustls-pki-types?/web", + "ring?/wasm32_unknown_unknown_js" +] sqlite = [ "dep:matrix-sdk-sqlite", @@ -62,7 +70,7 @@ experimental-encrypted-state-events = [ markdown = ["ruma/markdown"] native-tls = ["reqwest/native-tls"] -rustls-tls = ["reqwest/rustls-tls"] +rustls-tls = ["reqwest/rustls-no-provider", "dep:rustls", "dep:rustls-pki-types", "dep:ring"] socks = ["reqwest/socks"] local-server = ["dep:axum", "dep:rand", "dep:tower"] sso-login = ["local-server"] @@ -118,9 +126,11 @@ matrix-sdk-test = { workspace = true, optional = true } mime.workspace = true mime2ext = "0.1.54" oauth2.workspace = true +oauth2-reqwest.workspace = true percent-encoding = "2.3.2" pin-project-lite.workspace = true rand = { workspace = true, optional = true } +ring = { workspace = true, optional = true } ruma = { workspace = true, features = [ "rand", "unstable-msc2448", @@ -131,6 +141,8 @@ ruma = { workspace = true, features = [ "unstable-msc4108", "unstable-msc4278", ] } +rustls = { workspace = true, optional = true, features = ["std", "logging"] } +rustls-pki-types = { workspace = true, optional = true } serde.workspace = true serde_html_form.workspace = true serde_json.workspace = true @@ -179,6 +191,7 @@ tokio-test = "0.4.4" tracing-subscriber = { workspace = true, features = ["env-filter"] } [target.'cfg(not(target_family = "wasm"))'.dev-dependencies] +ctor = "0.2.9" proptest.workspace = true tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } wiremock.workspace = true diff --git a/crates/matrix-sdk/src/authentication/oauth/http_client.rs b/crates/matrix-sdk/src/authentication/oauth/http_client.rs index fa5b4985b26..d362321ca40 100644 --- a/crates/matrix-sdk/src/authentication/oauth/http_client.rs +++ b/crates/matrix-sdk/src/authentication/oauth/http_client.rs @@ -18,11 +18,12 @@ use matrix_sdk_base::BoxFuture; use oauth2::{ AsyncHttpClient, ErrorResponse, HttpClientError, HttpRequest, HttpResponse, RequestTokenError, }; +use oauth2_reqwest::ReqwestClient; /// An HTTP client for making OAuth 2.0 requests. #[derive(Debug, Clone)] pub(super) struct OAuthHttpClient { - pub(super) inner: reqwest::Client, + pub(super) inner: ReqwestClient, /// Rewrite HTTPS requests to use HTTP instead. /// /// This is a workaround to bypass some checks that require an HTTPS URL, diff --git a/crates/matrix-sdk/src/authentication/oauth/mod.rs b/crates/matrix-sdk/src/authentication/oauth/mod.rs index 37d988d2842..54df52c8aef 100644 --- a/crates/matrix-sdk/src/authentication/oauth/mod.rs +++ b/crates/matrix-sdk/src/authentication/oauth/mod.rs @@ -183,6 +183,7 @@ use oauth2::{ basic::BasicClient as OAuthClient, }; pub use oauth2::{ClientId, CsrfToken}; +use oauth2_reqwest::ReqwestClient; use ruma::{ DeviceId, OwnedDeviceId, api::client::discovery::get_authorization_server_metadata::{ @@ -279,7 +280,7 @@ pub struct OAuth { impl OAuth { pub(crate) fn new(client: Client) -> Self { let http_client = OAuthHttpClient { - inner: client.inner.http_client.inner.clone(), + inner: ReqwestClient::from(client.inner.http_client.inner.clone()), #[cfg(test)] insecure_rewrite_https_to_http: false, }; diff --git a/crates/matrix-sdk/src/client/builder/mod.rs b/crates/matrix-sdk/src/client/builder/mod.rs index 04c5fdee2b7..840316e29da 100644 --- a/crates/matrix-sdk/src/client/builder/mod.rs +++ b/crates/matrix-sdk/src/client/builder/mod.rs @@ -90,6 +90,10 @@ use crate::{ /// /// use matrix_sdk::Client; /// +/// // setting up rustls crypto provider if using rustls +/// #[cfg(feature = "rustls-tls")] +/// matrix_sdk::rustls::install_default_crypto_provider_if_none_installed(); +/// /// // setting up a custom http client /// let reqwest_builder = reqwest::ClientBuilder::new() /// .https_only(true) @@ -535,6 +539,9 @@ impl ClientBuilder { let homeserver_cfg = self.homeserver_cfg.ok_or(ClientBuildError::MissingHomeserver)?; Span::current().record("homeserver", debug(&homeserver_cfg)); + #[cfg(feature = "rustls-tls")] + crate::http_client::rustls::install_default_crypto_provider_if_none_installed(); + #[cfg_attr(target_family = "wasm", allow(clippy::infallible_destructuring_match))] let inner_http_client = match self.http_cfg.unwrap_or_default() { #[cfg(not(target_family = "wasm"))] diff --git a/crates/matrix-sdk/src/http_client/mod.rs b/crates/matrix-sdk/src/http_client/mod.rs index 20daf7f6c33..26bd18e2006 100644 --- a/crates/matrix-sdk/src/http_client/mod.rs +++ b/crates/matrix-sdk/src/http_client/mod.rs @@ -314,6 +314,56 @@ impl SupportedPathBuilder for path_builder::SinglePath { } } +#[cfg(feature = "rustls-tls")] +pub mod rustls { + //! Functions for configuring the default [`CryptoProvider`] when using + //! `reqwest` with `rustls`'s implementation of TLS. + + use rustls::crypto::CryptoProvider; + + /// The default [`CryptoProvider`] preferred by this crate. + /// + /// Typically, the default [`CryptoProvider`] for `rustls` + /// is `aws-lc-rs`, but due to licensing issues this crate + /// prefers `ring`. + pub fn default_crypto_provider() -> CryptoProvider { + rustls::crypto::ring::default_provider() + } + + /// The `rustls-tls` flag enables the `rustls` implementation of TLS for + /// `reqwest`, but without a [`CryptoProvider`]. This means that no + /// default provider is installed, which will cause `reqwest::Client::new()` + /// to panic. + /// + /// This functions installs the preferred default provider given by + /// [`default_crypto_provider`], if no default has previously been + /// installed. + pub fn install_default_crypto_provider_if_none_installed() { + if default_crypto_provider().install_default().is_ok() { + // This log message seems to cause `nextest` to get confused, + // so it won't be printed when running tests. + #[cfg(not(test))] + tracing::info!("No rustls crypto provider set, setting default provider to ring."); + } + } + + /// Install a default [`CryptoProvider`] for `rustls`, if one isn't already + /// installed. This uses [`ctor`] to run before any tests. + #[cfg(test)] + macro_rules! install_default_crypto_provider_for_tests { + () => { + #[cfg(not(target_family = "wasm"))] + #[ctor::ctor] + fn install_default_crypto_provider_for_tests() { + $crate::http_client::rustls::install_default_crypto_provider_if_none_installed(); + } + }; + } + + #[cfg(test)] + pub(crate) use install_default_crypto_provider_for_tests; +} + #[cfg(all(test, not(target_family = "wasm")))] mod tests { use std::{ diff --git a/crates/matrix-sdk/src/http_client/native.rs b/crates/matrix-sdk/src/http_client/native.rs index 00d8e69806f..55f38ffe1f4 100644 --- a/crates/matrix-sdk/src/http_client/native.rs +++ b/crates/matrix-sdk/src/http_client/native.rs @@ -191,20 +191,11 @@ impl HttpSettings { http_client = http_client.danger_accept_invalid_certs(true) } - if !self.additional_root_certificates.is_empty() { - info!( - "Adding {} additional root certificates to the HTTP client", - self.additional_root_certificates.len() - ); - - for cert in &self.additional_root_certificates { - http_client = http_client.add_root_certificate(cert.clone()); - } - } - if self.disable_built_in_root_certificates { info!("Built-in root certificates disabled in the HTTP client."); - http_client = http_client.tls_built_in_root_certs(false); + http_client = http_client.tls_certs_only(self.additional_root_certificates.clone()); + } else { + http_client = http_client.tls_certs_merge(self.additional_root_certificates.clone()); } if let Some(p) = &self.proxy { diff --git a/crates/matrix-sdk/src/lib.rs b/crates/matrix-sdk/src/lib.rs index f7ccf826ebd..3eff83e03a3 100644 --- a/crates/matrix-sdk/src/lib.rs +++ b/crates/matrix-sdk/src/lib.rs @@ -76,6 +76,8 @@ pub use error::{ RumaApiError, }; pub use http_client::TransmissionProgress; +#[cfg(feature = "rustls-tls")] +pub use http_client::rustls; #[cfg(all(feature = "e2e-encryption", feature = "sqlite"))] pub use matrix_sdk_sqlite::SqliteCryptoStore; #[cfg(feature = "sqlite")] @@ -101,3 +103,5 @@ pub mod test_utils; #[cfg(test)] matrix_sdk_test_utils::init_tracing_for_tests!(); +#[cfg(all(test, feature = "rustls-tls"))] +crate::http_client::rustls::install_default_crypto_provider_for_tests!(); diff --git a/testing/matrix-sdk-test/Cargo.toml b/testing/matrix-sdk-test/Cargo.toml index 910f2806c0d..ed749b541e8 100644 --- a/testing/matrix-sdk-test/Cargo.toml +++ b/testing/matrix-sdk-test/Cargo.toml @@ -41,7 +41,7 @@ tracing-subscriber = { workspace = true, features = ["env-filter"] } wiremock.workspace = true [target.'cfg(target_family = "wasm")'.dependencies] -getrandom = { workspace = true, features = ["js"] } +getrandom = { workspace = true, features = ["wasm_js"] } wasm-bindgen-test.workspace = true [lints] diff --git a/xtask/src/ci.rs b/xtask/src/ci.rs index 4324b96e59c..239cc8ada41 100644 --- a/xtask/src/ci.rs +++ b/xtask/src/ci.rs @@ -129,7 +129,7 @@ enum FeatureSet { NoEncryptionAndSqlite, SqliteCryptostore, ExperimentalEncryptedStateEvents, - RustlsTls, + NativeTls, Markdown, Socks, SsoLogin, @@ -262,7 +262,7 @@ fn check_clippy() -> Result<()> { "rustup run {NIGHTLY} cargo clippy --workspace --all-targets --exclude matrix-sdk-crypto --exclude xtask --no-default-features - --features native-tls,sso-login,sqlite,testing,experimental-element-recent-emojis + --features rustls-tls,sso-login,sqlite,testing,experimental-element-recent-emojis -- -D warnings" ) .run()?; @@ -283,21 +283,21 @@ fn check_docs() -> Result<()> { fn run_feature_tests(cmd: Option) -> Result<()> { let args = BTreeMap::from([ - (FeatureSet::NoEncryption, "--no-default-features --features sqlite,native-tls,testing"), + (FeatureSet::NoEncryption, "--no-default-features --features sqlite,rustls-tls,testing"), ( FeatureSet::NoSqlite, - "--no-default-features --features e2e-encryption,native-tls,testing", + "--no-default-features --features e2e-encryption,rustls-tls,testing", ), - (FeatureSet::NoEncryptionAndSqlite, "--no-default-features --features native-tls,testing"), + (FeatureSet::NoEncryptionAndSqlite, "--no-default-features --features rustls-tls,testing"), ( FeatureSet::SqliteCryptostore, - "--no-default-features --features e2e-encryption,sqlite,native-tls,testing", + "--no-default-features --features e2e-encryption,sqlite,rustls-tls,testing", ), ( FeatureSet::ExperimentalEncryptedStateEvents, - "--no-default-features --features experimental-encrypted-state-events,e2e-encryption,sqlite,native-tls,testing", + "--no-default-features --features experimental-encrypted-state-events,e2e-encryption,sqlite,rustls-tls,testing", ), - (FeatureSet::RustlsTls, "--no-default-features --features rustls-tls,testing"), + (FeatureSet::NativeTls, "--no-default-features --features native-tls,testing"), (FeatureSet::Markdown, "--features markdown,testing"), (FeatureSet::Socks, "--features socks,testing"), (FeatureSet::SsoLogin, "--features sso-login,testing"), diff --git a/xtask/src/fixup.rs b/xtask/src/fixup.rs index 5894a80e215..b989072cc28 100644 --- a/xtask/src/fixup.rs +++ b/xtask/src/fixup.rs @@ -69,7 +69,7 @@ fn fix_clippy() -> Result<()> { "rustup run {NIGHTLY} cargo clippy --workspace --all-targets --fix --allow-dirty --allow-staged --exclude matrix-sdk-crypto --exclude xtask - --no-default-features --features native-tls,sso-login + --no-default-features --features rustls-tls,sso-login -- -D warnings" ) .run()?; diff --git a/xtask/src/swift.rs b/xtask/src/swift.rs index 2c102c000d0..8fb192ee0a2 100644 --- a/xtask/src/swift.rs +++ b/xtask/src/swift.rs @@ -160,7 +160,7 @@ impl Platform { const FFI_LIBRARY_NAME: &str = "libmatrix_sdk_ffi.a"; /// The features enabled for the FFI library. -const FFI_FEATURES: &str = "native-tls,sentry"; +const FFI_FEATURES: &str = "rustls-tls,sentry"; /// The list of targets supported by the SDK. const TARGETS: &[Target] = &[