diff --git a/Cargo.lock b/Cargo.lock index b2e8e99950b..254acd436db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3930,7 +3930,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] @@ -6461,6 +6461,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9980d917ebb0c0536119ba501e90834767bffc3d60641457fd84a1f3fd337923" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework 3.5.1", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -6669,6 +6681,19 @@ dependencies = [ "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 2.10.0", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + [[package]] name = "security-framework-sys" version = "2.15.0" @@ -8938,9 +8963,14 @@ dependencies = [ "futures-util", "log", "native-tls", + "rustls", + "rustls-native-certs", + "rustls-pki-types", "tokio", "tokio-native-tls", + "tokio-rustls", "tungstenite", + "webpki-roots 0.26.11", ] [[package]] @@ -9327,6 +9357,8 @@ dependencies = [ "log", "native-tls", "rand 0.9.2", + "rustls", + "rustls-pki-types", "sha1", "thiserror 2.0.17", "url", @@ -10045,6 +10077,24 @@ dependencies = [ "web-sys", ] +[[package]] +name = "webpki-roots" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.3", +] + +[[package]] +name = "webpki-roots" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b130c0d2d49f8b6889abc456e795e82525204f27c42cf767cf0d7734e089b8" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "which" version = "4.4.2" diff --git a/sdks/rust/Cargo.toml b/sdks/rust/Cargo.toml index 6dc26e25d61..41457ec488e 100644 --- a/sdks/rust/Cargo.toml +++ b/sdks/rust/Cargo.toml @@ -8,6 +8,14 @@ rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["tls-native"] + +tls-native = ["tokio-tungstenite/native-tls"] +tls-rustls-webpki = ["tokio-tungstenite/rustls-tls-webpki-roots"] +tls-rustls-native = ["tokio-tungstenite/rustls-tls-native-roots"] +tls-none = [] + [dependencies] spacetimedb-data-structures.workspace = true spacetimedb-sats.workspace = true @@ -30,7 +38,7 @@ once_cell.workspace = true prometheus.workspace = true rand.workspace = true tokio.workspace = true -tokio-tungstenite.workspace = true +tokio-tungstenite = { version = "0.27.0", features = ["url"] } [dev-dependencies] # for quickstart-chat and cursive-chat examples