Skip to content

Commit f49b97c

Browse files
committed
Use rustls for Swift to support TLS 1.3
Currently Element X iOS does not support TLS 1.3, this PR shall fix that. Explanation: There is an official recommendation from Apple, that boils down to the following if you use cross-platform code with sockets (as we do with the rust sdk): > To use TLS in that case [BSD Sockets], add your own TLS implementation. > Don’t use Secure Transport for your TLS implementation. It’s been deprecated since 2019 > and doesn’t support TLS 1.3. If you have existing code that uses Secure Transport, make > a plan to migrate off it. Modern TLS implementations including TLS 1.3 on macOS are only available as a builtin via the Apple-specific URLSession / Network framework APIs, so APIs where you feed in an URL and get the response back. They are not available in combination with a generic sockets-based cross-platform code. With that in mind, there is currently no hope that rust-native-tls would support TLS 1.3 in the forseeable future as there is simply no native TLS implementation in current macOS/iOS that could be used by rust-native-tls. See https://developer.apple.com/documentation/technotes/tn3151-choosing-the-right-networking-api#TLS-best-practices Fixes: element-hq/element-x-ios#786 Signed-off-by: Christoph Settgast <[email protected]>
1 parent 9bf48ef commit f49b97c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bindings/matrix-sdk-ffi/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ language-tags = "0.3.2"
5757
log-panics = { version = "2", features = ["with-backtrace"] }
5858
paranoid-android = "0.2.1"
5959

60-
[target.'cfg(target_os = "android")'.dependencies.matrix-sdk]
60+
[target.'cfg(any(target_os = "android", target_os = "ios", target_os = "macos"))'.dependencies.matrix-sdk]
6161
workspace = true
6262
features = [
6363
"anyhow",
@@ -72,7 +72,7 @@ features = [
7272
"uniffi",
7373
]
7474

75-
[target.'cfg(not(target_os = "android"))'.dependencies.matrix-sdk]
75+
[target.'cfg(not(any(target_os = "android", target_os = "ios", target_os = "macos")))'.dependencies.matrix-sdk]
7676
workspace = true
7777
features = [
7878
"anyhow",

0 commit comments

Comments
 (0)