From be9b77e930accf9edf98fe12d5fff6d3808aab4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:00:24 +0000 Subject: [PATCH 1/4] Bump rustls from 0.21.12 to 0.23.13 in the cargo group Bumps the cargo group with 1 update: [rustls](https://github.com/rustls/rustls). Updates `rustls` from 0.21.12 to 0.23.13 - [Release notes](https://github.com/rustls/rustls/releases) - [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustls/rustls/compare/v/0.21.12...v/0.23.13) --- updated-dependencies: - dependency-name: rustls dependency-type: direct:production dependency-group: cargo ... Signed-off-by: dependabot[bot] --- Cargo.lock | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 2 +- 2 files changed, 165 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 826762a0..41d50a9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -112,6 +112,32 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "aws-lc-rs" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f47bb8cc16b669d267eeccf585aea077d0882f4777b1c1f740217885d6e6e5a3" +dependencies = [ + "aws-lc-sys", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2101df3813227bbaaaa0b04cd61c534c7954b22bd68d399b440be937dc63ff7" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] + [[package]] name = "backtrace" version = "0.3.74" @@ -165,6 +191,29 @@ dependencies = [ "serde", ] +[[package]] +name = "bindgen" +version = "0.69.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.79", + "which", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -224,9 +273,20 @@ version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" dependencies = [ + "jobserver", + "libc", "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -266,7 +326,7 @@ dependencies = [ "rand", "regex", "reqwest", - "rustls 0.21.12", + "rustls 0.23.13", "serde", "serde-aux", "serde_json", @@ -322,6 +382,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmake" +version = "0.1.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" +dependencies = [ + "cc", +] + [[package]] name = "concurrent-queue" version = "2.5.0" @@ -542,6 +622,12 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "either" version = "1.13.0" @@ -640,6 +726,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures" version = "0.3.30" @@ -770,6 +862,12 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "h2" version = "0.3.26" @@ -1163,12 +1261,30 @@ dependencies = [ "serde", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.72" @@ -1201,12 +1317,28 @@ dependencies = [ "spin 0.9.8", ] +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets 0.48.5", +] + [[package]] name = "libm" version = "0.2.8" @@ -1661,6 +1793,16 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +dependencies = [ + "proc-macro2", + "syn 2.0.79", +] + [[package]] name = "proc-macro-crate" version = "3.2.0" @@ -1872,6 +2014,12 @@ 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_version" version = "0.4.1" @@ -1912,6 +2060,8 @@ version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ + "aws-lc-rs", + "log", "once_cell", "ring 0.17.8", "rustls-pki-types", @@ -1961,6 +2111,7 @@ version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ + "aws-lc-rs", "ring 0.17.8", "rustls-pki-types", "untrusted 0.9.0", @@ -3061,6 +3212,18 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "whoami" version = "1.5.2" diff --git a/Cargo.toml b/Cargo.toml index eced124e..d3488f40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,7 +70,7 @@ pubserve = { version = "1.1.0", features = ["async", "send"] } sqlx-pg-uint = { version = "0.8.0", features = ["serde"], optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -rustls = "0.21.12" +rustls = "0.23.13" tokio-tungstenite = { version = "0.20.1", features = [ "rustls-tls-webpki-roots", ] } From fea15cb23a2beb267209012acb89211e39cdf5d3 Mon Sep 17 00:00:00 2001 From: kozabrada123 Date: Sun, 29 Dec 2024 09:37:15 +0100 Subject: [PATCH 2/4] deps: bump rustls and tokio_tungstenite --- Cargo.lock | 145 +++++++++++++++++----------- Cargo.toml | 4 +- src/gateway/backends/tungstenite.rs | 62 +++++------- 3 files changed, 115 insertions(+), 96 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41d50a9b..7d89b4aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -210,7 +210,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.79", + "syn 2.0.93", "which", ] @@ -263,9 +263,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" @@ -326,7 +326,7 @@ dependencies = [ "rand", "regex", "reqwest", - "rustls 0.23.13", + "rustls 0.23.20", "serde", "serde-aux", "serde_json", @@ -335,7 +335,7 @@ dependencies = [ "simple_logger", "sqlx", "sqlx-pg-uint", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-tungstenite", "url", @@ -353,7 +353,7 @@ version = "0.5.0" dependencies = [ "async-trait", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -553,7 +553,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -564,7 +564,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -799,7 +799,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -1158,7 +1158,7 @@ dependencies = [ "hyper 0.14.30", "rustls 0.21.12", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -1336,7 +1336,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -1748,7 +1748,7 @@ dependencies = [ "serde_urlencoded", "smallvec", "sync_wrapper 1.0.1", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util", "tracing", @@ -1764,7 +1764,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -1800,7 +1800,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -1814,9 +1814,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -1939,7 +1939,7 @@ dependencies = [ "sync_wrapper 0.1.2", "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -2056,9 +2056,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "aws-lc-rs", "log", @@ -2091,9 +2091,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-webpki" @@ -2203,7 +2203,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -2226,7 +2226,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -2268,7 +2268,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -2317,7 +2317,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint", "num-traits", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -2437,14 +2437,14 @@ dependencies = [ "once_cell", "paste", "percent-encoding", - "rustls 0.23.13", + "rustls 0.23.20", "rustls-pemfile 2.1.3", "serde", "serde_json", "sha2", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tracing", @@ -2462,7 +2462,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -2485,7 +2485,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.79", + "syn 2.0.93", "tempfile", "tokio", "url", @@ -2530,7 +2530,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.64", "tracing", "whoami", ] @@ -2545,7 +2545,7 @@ dependencies = [ "serde", "sqlx", "sqlx-pg-uint-macros", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -2555,7 +2555,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "087085ea4ec76bb36e7737c7f8c73ea63ea31243301ed00860ba0758f277dcf2" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -2595,7 +2595,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.64", "tracing", "whoami", ] @@ -2660,9 +2660,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" dependencies = [ "proc-macro2", "quote", @@ -2724,7 +2724,16 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.64", +] + +[[package]] +name = "thiserror" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +dependencies = [ + "thiserror-impl 2.0.9", ] [[package]] @@ -2735,7 +2744,18 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.93", ] [[package]] @@ -2808,7 +2828,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -2821,6 +2841,16 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +dependencies = [ + "rustls 0.23.20", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.16" @@ -2834,17 +2864,18 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.20.1" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +checksum = "be4bf6fecd69fcdede0ec680aaf474cdab988f9de6bc73d3758f0160e3b7025a" dependencies = [ "futures-util", "log", - "rustls 0.21.12", + "rustls 0.23.20", + "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.1", "tungstenite", - "webpki-roots 0.25.4", + "webpki-roots 0.26.6", ] [[package]] @@ -2903,7 +2934,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -2923,21 +2954,21 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.20.1" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "413083a99c579593656008130e29255e54dcaae495be556cc26888f211648c24" dependencies = [ "byteorder", "bytes", "data-encoding", - "http 0.2.12", + "http 1.1.0", "httparse", "log", "rand", - "rustls 0.21.12", + "rustls 0.23.20", + "rustls-pki-types", "sha1", - "thiserror", - "url", + "thiserror 2.0.9", "utf-8", ] @@ -3102,7 +3133,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", "wasm-bindgen-shared", ] @@ -3136,7 +3167,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3170,7 +3201,7 @@ checksum = "c97b2ef2c8d627381e51c071c2ab328eac606d3f69dd82bcbca20a9e389d95f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] @@ -3262,7 +3293,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -3460,7 +3491,7 @@ dependencies = [ "pharos", "rustc_version", "send_wrapper", - "thiserror", + "thiserror 1.0.64", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3484,7 +3515,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.93", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d3488f40..e15c40b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,8 +70,8 @@ pubserve = { version = "1.1.0", features = ["async", "send"] } sqlx-pg-uint = { version = "0.8.0", features = ["serde"], optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -rustls = "0.23.13" -tokio-tungstenite = { version = "0.20.1", features = [ +rustls = "0.23.20" +tokio-tungstenite = { version = "0.26.1", features = [ "rustls-tls-webpki-roots", ] } hostname = "0.3.1" diff --git a/src/gateway/backends/tungstenite.rs b/src/gateway/backends/tungstenite.rs index 40d30827..58cfabed 100644 --- a/src/gateway/backends/tungstenite.rs +++ b/src/gateway/backends/tungstenite.rs @@ -2,6 +2,8 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +use std::sync::Arc; + use custom_error::custom_error; use futures_util::{ stream::{SplitSink, SplitStream}, @@ -9,9 +11,8 @@ use futures_util::{ }; use tokio::net::TcpStream; use tokio_tungstenite::{ - connect_async_tls_with_config, connect_async_with_config, - tungstenite::self, - Connector, MaybeTlsStream, WebSocketStream, + connect_async_tls_with_config, connect_async_with_config, tungstenite, Connector, + MaybeTlsStream, WebSocketStream, }; use url::Url; @@ -53,37 +54,24 @@ impl TungsteniteBackend { Ok(websocket_stream.split()) } else if websocket_url_parsed.scheme() == "wss" { - let certs = webpki_roots::TLS_SERVER_ROOTS; - let roots = rustls::RootCertStore { - roots: certs - .iter() - .map(|cert| { - rustls::OwnedTrustAnchor::from_subject_spki_name_constraints( - cert.subject.to_vec(), - cert.subject_public_key_info.to_vec(), - cert.name_constraints.as_ref().map(|der| der.to_vec()), - ) - }) - .collect(), - }; - let (websocket_stream, _) = match connect_async_tls_with_config( - websocket_url, - None, - false, - Some(Connector::Rustls( - rustls::ClientConfig::builder() - .with_safe_defaults() - .with_root_certificates(roots) - .with_no_client_auth() - .into(), - )), - ) - .await - { - Ok(websocket_stream) => websocket_stream, - Err(e) => return Err(TungsteniteBackendError::TungsteniteError { error: e }), + let root_store = rustls::RootCertStore { + roots: webpki_roots::TLS_SERVER_ROOTS.into(), }; + let config = rustls::ClientConfig::builder() + .with_root_certificates(root_store) + .with_no_client_auth(); + + let connector = Connector::Rustls(Arc::new(config)); + + let (websocket_stream, _) = + match connect_async_tls_with_config(websocket_url, None, false, Some(connector)) + .await + { + Ok(websocket_stream) => websocket_stream, + Err(e) => return Err(TungsteniteBackendError::TungsteniteError { error: e }), + }; + Ok(websocket_stream.split()) } else { Err(TungsteniteBackendError::TungsteniteError { @@ -97,7 +85,7 @@ impl TungsteniteBackend { impl From for tungstenite::Message { fn from(message: GatewayMessage) -> Self { - Self::Text(message.0) + Self::Text(message.0.into()) } } @@ -110,8 +98,8 @@ impl From for GatewayMessage { impl From for tungstenite::Message { fn from(message: RawGatewayMessage) -> Self { match message { - RawGatewayMessage::Text(text) => tungstenite::Message::Text(text), - RawGatewayMessage::Bytes(bytes) => tungstenite::Message::Binary(bytes), + RawGatewayMessage::Text(text) => tungstenite::Message::Text(text.into()), + RawGatewayMessage::Bytes(bytes) => tungstenite::Message::Binary(bytes.into()), } } } @@ -120,10 +108,10 @@ impl From for GatewayCommunication { fn from(value: tungstenite::Message) -> Self { match value { tungstenite::Message::Binary(bytes) => { - GatewayCommunication::Message(RawGatewayMessage::Bytes(bytes)) + GatewayCommunication::Message(RawGatewayMessage::Bytes(bytes.to_vec())) } tungstenite::Message::Text(text) => { - GatewayCommunication::Message(RawGatewayMessage::Text(text)) + GatewayCommunication::Message(RawGatewayMessage::Text(text.to_string())) } tungstenite::Message::Close(close_frame) => { if close_frame.is_none() { From db258e2e2867fecd76a7f2decfa5f06de38c9406 Mon Sep 17 00:00:00 2001 From: kozabrada123 Date: Sun, 29 Dec 2024 09:37:37 +0100 Subject: [PATCH 3/4] chore: remove an unused import in gateway/message.rs --- src/gateway/message.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gateway/message.rs b/src/gateway/message.rs index cae45af3..e0766986 100644 --- a/src/gateway/message.rs +++ b/src/gateway/message.rs @@ -6,8 +6,6 @@ use std::string::FromUtf8Error; use crate::types::{CloseCode, GatewayReceivePayload}; -use super::*; - #[derive(Clone, Debug, PartialEq, Eq)] /// Defines a communication received from the gateway, being either an optionally compressed /// [RawGatewayMessage] or a [CloseCode]. From 02ed445c72cd8580ef3d4026d3324e0f763eece8 Mon Sep 17 00:00:00 2001 From: kozabrada123 Date: Sun, 29 Dec 2024 09:44:02 +0100 Subject: [PATCH 4/4] fix: update vgw as well --- src/voice/gateway/backends/tungstenite.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/voice/gateway/backends/tungstenite.rs b/src/voice/gateway/backends/tungstenite.rs index 8989deb6..53388b5f 100644 --- a/src/voice/gateway/backends/tungstenite.rs +++ b/src/voice/gateway/backends/tungstenite.rs @@ -7,7 +7,7 @@ use crate::voice::gateway::{VoiceGatewayCommunication, VoiceGatewayMessage}; impl From for tokio_tungstenite::tungstenite::Message { fn from(message: VoiceGatewayMessage) -> Self { - Self::Text(message.0) + Self::Text(message.0.into()) } } @@ -21,7 +21,7 @@ impl From for VoiceGatewayCommunication fn from(value: tokio_tungstenite::tungstenite::Message) -> Self { match value { tokio_tungstenite::tungstenite::Message::Text(text) => { - VoiceGatewayCommunication::Message(VoiceGatewayMessage(text)) + VoiceGatewayCommunication::Message(VoiceGatewayMessage(text.to_string())) } tokio_tungstenite::tungstenite::Message::Close(close_frame) => { if close_frame.is_none() {