diff --git a/Cargo.lock b/Cargo.lock index f3bf1019d..6902ad945 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aead" version = "0.5.2" @@ -91,9 +97,9 @@ dependencies = [ [[package]] name = "amplify" -version = "4.6.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e711289a6cb28171b4f0e6c8019c69ff9476050508dc082167575d458ff74d0" +checksum = "7147b742325842988dd6c793d55f58df3ae36bccf7d9b6e07db10ab035be343d" dependencies = [ "amplify_derive", "amplify_num", @@ -103,9 +109,9 @@ dependencies = [ [[package]] name = "amplify_derive" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759dcbfaf94d838367a86d493ec34ccc8aa6fe365cb7880d6bf89006de24d9c1" +checksum = "2a6309e6b8d89b36b9f959b7a8fa093583b94922a0f6438a24fb08936de4d428" dependencies = [ "amplify_syn", "proc-macro2", @@ -115,9 +121,9 @@ dependencies = [ [[package]] name = "amplify_num" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c009c5c4de814911b177e2ea59e4930bb918978ed3cce4900d846a6ceb0838" +checksum = "99bcb75a2982047f733547042fc3968c0f460dfcf7d90b90dea3b2744580e9ad" dependencies = [ "wasm-bindgen", ] @@ -223,9 +229,9 @@ checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "arti-client" @@ -302,7 +308,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -324,18 +330,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -404,10 +410,10 @@ dependencies = [ "base64 0.21.7", "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.1", + "http", + "http-body", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-util", "itoa", "matchit", @@ -424,7 +430,7 @@ dependencies = [ "sync_wrapper 1.0.1", "tokio", "tokio-tungstenite 0.21.0", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -439,8 +445,8 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.1", + "http", + "http-body", "http-body-util", "mime", "pin-project-lite", @@ -460,7 +466,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -473,7 +479,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.4", "object", "rustc-demangle", ] @@ -524,7 +530,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 1.0.109", "which", @@ -547,9 +553,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", - "syn 2.0.72", + "syn 2.0.77", "which", ] @@ -588,9 +594,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" +checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" dependencies = [ "arrayref", "arrayvec", @@ -607,7 +613,7 @@ checksum = "e0b121a9fe0df916e362fb3271088d071159cdf11db0e4182d02152850756eff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -631,9 +637,9 @@ dependencies = [ "futures-core", "futures-util", "hex", - "http 1.1.0", + "http", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-named-pipe", "hyper-util", "hyperlocal", @@ -733,9 +739,9 @@ checksum = "11aade7a05aa8c3a351cedc44c3fc45806430543382fcc4743a9b757a2a0b4ed" [[package]] name = "bytemuck" -version = "1.16.1" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" +checksum = "773d90827bc3feecfb67fab12e24de0749aad83c74b9504ecde46237b5cd24e2" [[package]] name = "byteorder" @@ -793,12 +799,13 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.7" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -944,7 +951,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -999,16 +1006,18 @@ dependencies = [ "filetime", "foreign-types-shared", "futures", - "h2 0.4.6", + "h2", "hickory-client", - "hickory-proto", - "hickory-resolver", + "hickory-proto 0.25.0-alpha.2", + "hickory-resolver 0.25.0-alpha.2", "hickory-server", "hmac", - "http 1.1.0", + "http", + "http-body-util", "httparse", - "hyper 0.14.30", + "hyper", "hyper-rustls", + "hyper-util", "ip_network_table-deps-treebitmap", "ipnet", "libc", @@ -1034,7 +1043,7 @@ dependencies = [ "regex", "register-count", "ring-compat", - "rustls 0.21.8", + "rustls", "rustls-pemfile", "security-framework", "serde", @@ -1054,7 +1063,7 @@ dependencies = [ "tokio-tungstenite 0.23.1", "tokio-util", "tor-rtcompat", - "tower", + "tower 0.5.0", "tower-http", "tracing", "tracing-appender", @@ -1150,9 +1159,9 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "convert_case" @@ -1172,15 +1181,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -1350,7 +1359,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1398,7 +1407,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1420,7 +1429,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1449,7 +1458,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1526,14 +1535,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1b84d32b18d9a256d81e4fec2e4cfd0ab6dde5e5ff49be1713ae0adbd0060c2" dependencies = [ "heck 0.5.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "itertools 0.13.0", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "sha3", "strum 0.26.3", - "syn 2.0.72", + "syn 2.0.77", "void", ] @@ -1578,7 +1587,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1652,7 +1661,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1783,7 +1792,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1796,7 +1805,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1850,9 +1859,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "ff" @@ -1903,12 +1912,12 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -1946,9 +1955,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "fs-mistrust" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa843fc37db9fe16a248421fa36454f903dbc2ff722cc613a7e12932ee572c7" +checksum = "2492d7196a25acaf48f197574ddf3b90e98c3a0c6b1f9ed9be7df0d9a8a9ec85" dependencies = [ "derive_builder_fork_arti", "dirs", @@ -2041,7 +2050,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2051,7 +2060,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.12", + "rustls", "rustls-pki-types", ] @@ -2157,25 +2166,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.6" @@ -2187,8 +2177,8 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", - "indexmap 2.2.6", + "http", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2280,6 +2270,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -2288,15 +2284,15 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hickory-client" -version = "0.24.1" +version = "0.25.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab9683b08d8f8957a857b0236455d80e1886eaa8c6178af556aa7871fb61b55" +checksum = "90078f18923f3a7663f62fbd43c4030de758d16efae0071cdf3ef9c6358cbf49" dependencies = [ "cfg-if", "data-encoding", "futures-channel", "futures-util", - "hickory-proto", + "hickory-proto 0.25.0-alpha.2", "once_cell", "radix_trie", "rand", @@ -2312,24 +2308,51 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" dependencies = [ "async-trait", - "bytes", "cfg-if", "data-encoding", "enum-as-inner 0.6.0", "futures-channel", "futures-io", "futures-util", - "h2 0.3.26", - "http 0.2.12", "idna 0.4.0", "ipnet", "once_cell", "rand", - "ring 0.16.20", - "rustls 0.21.8", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-proto" +version = "0.25.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8270a1857fb962b9914aafd46a89a187a4e63d0eb4190c327e7c7b8256a2d055" +dependencies = [ + "async-recursion", + "async-trait", + "bitflags 2.6.0", + "bytes", + "cfg-if", + "data-encoding", + "enum-as-inner 0.6.0", + "futures-channel", + "futures-io", + "futures-util", + "h2", + "http", + "idna 0.5.0", + "ipnet", + "once_cell", + "rand", + "ring 0.17.8", + "rustls", "rustls-pemfile", "serde", "thiserror", + "time", "tinyvec", "tokio", "tokio-rustls", @@ -2337,6 +2360,28 @@ dependencies = [ "url", ] +[[package]] +name = "hickory-recursor" +version = "0.25.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0d2b7bc3b967b53b1b9879e319c8cc4ec037bb5d25bc7a88edd2e6de15d1a70" +dependencies = [ + "async-recursion", + "async-trait", + "bytes", + "cfg-if", + "enum-as-inner 0.6.0", + "futures-util", + "hickory-proto 0.25.0-alpha.2", + "hickory-resolver 0.25.0-alpha.2", + "lru-cache", + "parking_lot", + "serde", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "hickory-resolver" version = "0.24.1" @@ -2345,14 +2390,35 @@ checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" dependencies = [ "cfg-if", "futures-util", - "hickory-proto", + "hickory-proto 0.24.1", "ipconfig", "lru-cache", "once_cell", "parking_lot", "rand", "resolv-conf", - "rustls 0.21.8", + "smallvec", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "hickory-resolver" +version = "0.25.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c110355b5703070d9e29c344d79818a7cde3de9c27fc35750defea6074b0ad" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto 0.25.0-alpha.2", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot", + "rand", + "resolv-conf", + "rustls", "serde", "smallvec", "thiserror", @@ -2363,20 +2429,23 @@ dependencies = [ [[package]] name = "hickory-server" -version = "0.24.1" +version = "0.25.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be0e43c556b9b3fdb6c7c71a9a32153a2275d02419e3de809e520bfcfe40c37" +checksum = "1ee9bc516413439e322999f9c3263361b0454969cd53f20d26297ed8aa1e77c1" dependencies = [ "async-trait", "bytes", "cfg-if", "enum-as-inner 0.6.0", "futures-util", - "h2 0.3.26", - "hickory-proto", - "hickory-resolver", - "http 0.2.12", - "rustls 0.21.8", + "h2", + "hickory-proto 0.25.0-alpha.2", + "hickory-recursor", + "hickory-resolver 0.25.0-alpha.2", + "http", + "ipnet", + "prefix-trie", + "rustls", "serde", "thiserror", "time", @@ -2430,17 +2499,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f558a64ac9af88b5ba400d99b579451af0d39c6d360980045b91aac966d705e2" -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http" version = "1.1.0" @@ -2452,17 +2510,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.1" @@ -2470,7 +2517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] @@ -2481,8 +2528,8 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.1", + "http", + "http-body", "pin-project-lite", ] @@ -2520,30 +2567,6 @@ dependencies = [ "serde", ] -[[package]] -name = "hyper" -version = "0.14.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.4.1" @@ -2553,9 +2576,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", - "http 1.1.0", - "http-body 1.0.1", + "h2", + "http", + "http-body", "httparse", "httpdate", "itoa", @@ -2572,7 +2595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" dependencies = [ "hex", - "hyper 1.4.1", + "hyper", "hyper-util", "pin-project-lite", "tokio", @@ -2582,18 +2605,19 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.2" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", - "http 0.2.12", - "hyper 0.14.30", - "log", - "rustls 0.21.8", - "rustls-native-certs", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", "tokio", "tokio-rustls", + "tower-service", ] [[package]] @@ -2602,7 +2626,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ - "hyper 1.4.1", + "hyper", "hyper-util", "pin-project-lite", "tokio", @@ -2611,20 +2635,20 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "hyper 1.4.1", + "http", + "http-body", + "hyper", "pin-project-lite", "socket2", "tokio", - "tower", + "tower 0.4.13", "tower-service", "tracing", ] @@ -2637,7 +2661,7 @@ checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7" dependencies = [ "hex", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-util", "pin-project-lite", "tokio", @@ -2717,9 +2741,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -2806,6 +2830,9 @@ name = "ipnet" version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +dependencies = [ + "serde", +] [[package]] name = "ipnetwork" @@ -2818,11 +2845,11 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] @@ -2886,9 +2913,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -3167,6 +3194,15 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" version = "0.8.11" @@ -3181,11 +3217,11 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", @@ -3214,7 +3250,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3394,17 +3430,17 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "object" -version = "0.36.2" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -3427,12 +3463,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - [[package]] name = "opentelemetry" version = "0.24.0" @@ -3464,7 +3494,7 @@ checksum = "6b925a602ffb916fb7421276b86756027b37ee708f9dce2dbdcc51739f07e727" dependencies = [ "async-trait", "futures-core", - "http 1.1.0", + "http", "opentelemetry", "opentelemetry-proto", "opentelemetry_sdk", @@ -3635,7 +3665,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.5.0", ] [[package]] @@ -3668,7 +3698,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3697,7 +3727,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3813,12 +3843,11 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2288c0e17cc8d342c712bb43a257a80ebffce59cdb33d5000d8348f3ec02528b" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ "zerocopy", - "zerocopy-derive", ] [[package]] @@ -3847,14 +3876,24 @@ dependencies = [ "termtree", ] +[[package]] +name = "prefix-trie" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cb065e4407d69a5a5265221262cceeafff7f1aabc545d01ed955cce92ee78b" +dependencies = [ + "ipnet", + "num-traits", +] + [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3868,13 +3907,13 @@ dependencies = [ [[package]] name = "priority-queue" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70c501afe3a2e25c9bd219aa56ec1e04cdb3fcdd763055be268778c13fa82c1f" +checksum = "560bcab673ff7f6ca9e270c17bf3affd8a05e3bd9207f123b0d45076fd8197e8" dependencies = [ "autocfg", "equivalent", - "indexmap 2.2.6", + "indexmap 2.5.0", ] [[package]] @@ -3889,11 +3928,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.22.20", ] [[package]] @@ -3931,9 +3970,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" +checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" dependencies = [ "bytes", "prost-derive", @@ -3941,9 +3980,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1" +checksum = "f8650aabb6c35b860610e9cff5dc1af886c9e25073b7b1712a68972af4281302" dependencies = [ "bytes", "heck 0.5.0", @@ -3956,28 +3995,28 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.72", + "syn 2.0.77", "tempfile", ] [[package]] name = "prost-derive" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" +checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" dependencies = [ "anyhow", "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "prost-types" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" +checksum = "60caa6738c7369b940c3d49246a8d1749323674c65cb13010134f5c9bad5b519" dependencies = [ "prost", ] @@ -4024,17 +4063,18 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.10.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", "futures-io", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", - "rustls 0.21.8", + "rustc-hash 2.0.0", + "rustls", + "socket2", "thiserror", "tokio", "tracing", @@ -4042,15 +4082,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.10.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand", - "ring 0.16.20", - "rustc-hash", - "rustls 0.21.8", + "ring 0.17.8", + "rustc-hash 2.0.0", + "rustls", "slab", "thiserror", "tinyvec", @@ -4059,22 +4099,22 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.4.1" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ - "bytes", "libc", + "once_cell", "socket2", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -4165,9 +4205,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -4347,20 +4387,26 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags 2.6.0", "errno", @@ -4369,74 +4415,41 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.21.8" -source = "git+https://github.com/Watfaq/rustls.git?rev=43ecd5c610741668488e6d57857f9900a2087a5b#43ecd5c610741668488e6d57857f9900a2087a5b" -dependencies = [ - "log", - "ring 0.17.8", - "rustls-webpki 0.101.7", - "sct", -] - [[package]] name = "rustls" version = "0.23.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +source = "git+https://github.com/Watfaq/rustls.git?rev=f84c0f8020b252978e9b157179e9a99233cd33aa#f84c0f8020b252978e9b157179e9a99233cd33aa" dependencies = [ "log", "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki", "subtle", "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "schannel", - "security-framework", -] - [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", + "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" - -[[package]] -name = "rustls-webpki" -version = "0.101.7" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -4489,43 +4502,24 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.6" +version = "2.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ccfb12511cdb770157ace92d7dda771e498445b78f9886e8cdbc5140a4eced" +checksum = "aeb7ac86243095b70a7920639507b71d51a63390d1ba26c4f60a552fbb914a37" dependencies = [ "sdd", ] -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - [[package]] name = "sdd" -version = "2.1.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177258b64c0faaa9ffd3c65cd3262c2bc7e2588dbbd9c1641d0346145c1bbda8" +checksum = "0495e4577c672de8254beb68d01a9b62d0e8a13c099edecdbedccce3223cd29f" [[package]] name = "sec1" @@ -4607,7 +4601,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4649,7 +4643,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4683,7 +4677,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_derive", "serde_json", @@ -4700,7 +4694,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4709,7 +4703,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "itoa", "ryu", "serde", @@ -4738,7 +4732,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4788,7 +4782,7 @@ dependencies = [ "bytes", "cfg-if", "futures", - "hickory-resolver", + "hickory-resolver 0.24.1", "libc", "log", "lru_time_cache", @@ -5061,7 +5055,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5074,7 +5068,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5096,9 +5090,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -5159,7 +5153,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5239,14 +5233,14 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.1", + "mio 1.0.2", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -5264,15 +5258,16 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "tokio-rustls" -version = "0.24.1" -source = "git+https://github.com/Watfaq/tokio-rustls.git?rev=fcda89f6348c1e696b239bc7e0b168015cfb8c08#fcda89f6348c1e696b239bc7e0b168015cfb8c08" +version = "0.26.0" +source = "git+https://github.com/Watfaq/tokio-rustls.git?rev=6b9af8ac7bb5abc159d9a67e9ddbf84127559a4a#6b9af8ac7bb5abc159d9a67e9ddbf84127559a4a" dependencies = [ - "rustls 0.21.8", + "rustls", + "rustls-pki-types", "tokio", ] @@ -5357,14 +5352,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.17" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a44eede9b727419af8095cb2d72fab15487a541f54647ad4414b34096ee4631" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.18", + "toml_edit 0.22.20", ] [[package]] @@ -5382,51 +5377,40 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1490595c74d930da779e944f5ba2ecdf538af67df1a9848cbd156af43c1b7cf0" -dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.16", + "winnow 0.6.18", ] [[package]] name = "tonic" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38659f4a91aba8598d27821589f5db7dddd94601e7a01b1e485a50e5484c7401" +checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad" dependencies = [ "async-stream", "async-trait", "axum", "base64 0.22.1", "bytes", - "h2 0.4.6", - "http 1.1.0", - "http-body 1.0.1", + "h2", + "http", + "http-body", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-timeout", "hyper-util", "percent-encoding", @@ -5435,7 +5419,7 @@ dependencies = [ "socket2", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -5666,7 +5650,7 @@ dependencies = [ "derive_more", "futures", "hex", - "http 1.1.0", + "http", "httparse", "httpdate", "itertools 0.13.0", @@ -6229,6 +6213,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36b837f86b25d7c0d7988f00a54e74739be6477f2aac6201b8f429a7569991b7" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-http" version = "0.5.2" @@ -6238,8 +6236,8 @@ dependencies = [ "bitflags 2.6.0", "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.1", + "http", + "http-body", "http-body-util", "http-range-header", "httpdate", @@ -6256,15 +6254,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -6298,7 +6296,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -6391,7 +6389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -6444,7 +6442,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tuic" version = "5.0.0" -source = "git+https://github.com/Itsusinn/tuic.git?rev=82fab62#82fab626d6344f69f26ce4af7c87916f640ee3d3" +source = "git+https://github.com/Itsusinn/tuic.git?tag=v1.1.2-fix1#d6e1416d923cbc5f80fafc51927823ada3693901" dependencies = [ "bytes", "futures-util", @@ -6457,7 +6455,7 @@ dependencies = [ [[package]] name = "tuic-quinn" version = "0.1.0" -source = "git+https://github.com/Itsusinn/tuic.git?rev=82fab62#82fab626d6344f69f26ce4af7c87916f640ee3d3" +source = "git+https://github.com/Itsusinn/tuic.git?tag=v1.1.2-fix1#d6e1416d923cbc5f80fafc51927823ada3693901" dependencies = [ "bytes", "futures-util", @@ -6493,7 +6491,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http", "httparse", "log", "rand", @@ -6512,7 +6510,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http", "httparse", "log", "rand", @@ -6529,9 +6527,9 @@ checksum = "183496e014253d15abbe6235677b1392dba2d40524c88938991226baa38ac7c4" [[package]] name = "typeid" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "059d83cc991e7a42fc37bd50941885db0888e34209f8cfd9aab07ddec03bc9cf" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" [[package]] name = "typenum" @@ -6650,7 +6648,7 @@ checksum = "ee1cd046f83ea2c4e920d6ee9f7c3537ef928d75dce5d84a87c2c5d6b3999a3a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -6673,13 +6671,13 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "visibility" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3fd98999db9227cf28e59d83e1f120f42bc233d4b152e8fab9bc87d5bb1e0f8" +checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -6730,34 +6728,35 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6765,22 +6764,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "weak-table" @@ -6790,9 +6789,9 @@ checksum = "323f4da9523e9a669e1eaf9c6e763892769b1d38c623913647bfdc1532fe4549" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -6810,9 +6809,12 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +dependencies = [ + "rustls-pki-types", +] [[package]] name = "which" @@ -6850,11 +6852,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6922,7 +6924,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -6933,7 +6935,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -7114,9 +7116,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.16" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -7202,7 +7204,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -7222,7 +7224,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -7236,18 +7238,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.2.0" +version = "7.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa556e971e7b568dc775c136fc9de8c779b1c2fc3a63defaafadffdbd3181afa" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.12+zstd.1.5.6" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index b43ab15b8..0bcd6b856 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,5 +20,5 @@ lto = true strip = true [patch.crates-io] -tokio-rustls = { git = "https://github.com/Watfaq/tokio-rustls.git", rev = "fcda89f6348c1e696b239bc7e0b168015cfb8c08"} -rustls = { git = "https://github.com/Watfaq/rustls.git", rev = "43ecd5c610741668488e6d57857f9900a2087a5b"} +tokio-rustls = { git = "https://github.com/Watfaq/tokio-rustls.git", rev = "6b9af8ac7bb5abc159d9a67e9ddbf84127559a4a"} +rustls = { git = "https://github.com/Watfaq/rustls.git", rev = "f84c0f8020b252978e9b157179e9a99233cd33aa"} diff --git a/clash_lib/Cargo.toml b/clash_lib/Cargo.toml index 4c4b11a08..42a344e2f 100644 --- a/clash_lib/Cargo.toml +++ b/clash_lib/Cargo.toml @@ -13,35 +13,32 @@ bench = ["criterion"] onion = ["arti-client/onion-service-client"] [dependencies] +# Async tokio = { version = "1", features = ["full"] } tokio-util = { version = "0.7", features = ["net", "codec", "io", "compat"] } -thiserror = "1.0" -async-trait = "0.1" -anyhow = "1" futures = "0.3" -bytes = "1.7" async-recursion = "1" -ipnet = "2.9" -url = "2.5" -regex = "1" -byteorder = "1.5" -lru_time_cache = "0.11" -hyper = { version = "0.14.28", features = ["http1","http2","client", "server", "tcp"] } -http = { version = "1.1" } -httparse = "1.9.4" -h2 = "0.4.6" -prost = "0.13" -tower = { version = "0.4", features = ["util"] } -libc = "0.2" -foreign-types-shared = "0.3.1" -network-interface = "2.0.0" -base64 = "0.22" -uuid = { version = "1.10.0", features = ["v4", "fast-rng", "macro-diagnostics", "serde"] } +async-trait = "0.1" +hyper = { version = "1", features = ["http1","http2","client", "server"] } +hyper-util = "0.1" -ip_network_table-deps-treebitmap = "0.5.0" -once_cell = "1.18.0" -# opentelemetry +# Network proto +http = { version = "1" } +http-body-util = "0.1.2" +socket2 = { version = "0.5", features = ["all"] } +tokio-tungstenite = "0.23.1" + +# TLS +tokio-rustls = { version = "0.26", default-features = false, features = ["logging", "tls12"] } +hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "http2"] } +rustls = { version = "0.23", default-features = false, features=["ring"] } +rustls-pemfile = "2" +webpki-roots = "0.26" + +# Error handing & logging +thiserror = "1" +anyhow = "1" opentelemetry = "0.24" opentelemetry_sdk = { version = "0.24", default-features = false, features = ["trace", "rt-tokio"] } tracing-opentelemetry = "0.25" @@ -49,78 +46,94 @@ opentelemetry-jaeger-propagator = "0.3" opentelemetry-otlp = { version = "0.17" } opentelemetry-semantic-conventions = "0.16" -crc32fast = "1.4.2" -brotli = "6.0.0" -hmac = "0.12.1" +# Data structures +url = "2" +bytes = "1" +ipnet = "2" +regex = "1" +byteorder = "1" +lru_time_cache ="0.11" +uuid = { version = "1", features = ["v4", "fast-rng", "macro-diagnostics", "serde"] } +foreign-types-shared = "0.3" +network-interface = "2" +base64 = "0.22" + +httparse = "1" +h2 = "0.4" +prost = "0.13" +tower = { version = "0.5", features = ["util"] } +libc = "0.2" + +ip_network_table-deps-treebitmap = "0.5" +once_cell = "1" + +# Algorithms +crc32fast = "1" +brotli = "6" +hmac = "0.12" sha1 = "0.10" -sha2 = "0.10.8" +sha2 = "0.10" md-5 = "0.10" chacha20poly1305 = "0.10" -aead = { version = "0.5.2", features = ["std"] } -aes = "0.8.4" +aead = { version = "0.5", features = ["std"] } +aes = "0.8" aes-gcm = "0.10" -cfb-mode = "0.8.2" +cfb-mode = "0.8" const-fnv1a-hash = "1" filetime = "0.2" axum = { version = "0.7", features = ["ws"] } -tower-http = { version = "0.5.2", features = ["fs", "trace", "cors"] } -chrono = { version = "0.4.38", features = ["serde"] } +tower-http = { version = "0.5", features = ["fs", "trace", "cors"] } +chrono = { version = "0.4", features = ["serde"] } tun = { git = "https://github.com/Watfaq/rust-tun.git", rev = "8f7568190f1200d3e272ca534baf8d1578147e18", features = ["async"] } netstack-lwip = { git = "https://github.com/Watfaq/netstack-lwip.git", rev = "2817bf82740e04bbee6b7bf1165f55657a6ed163" } -boringtun = { version = "0.6.0", git = "https://github.com/cloudflare/boringtun.git", rev = "f672bb6c1e1e371240a8d151f15854687eb740bb" } +boringtun = { version = "0.6", git = "https://github.com/cloudflare/boringtun.git", rev = "f672bb6c1e1e371240a8d151f15854687eb740bb" } smoltcp = { version = "0.11", default-features = false, features = ["std", "log", "medium-ip", "proto-ipv4", "proto-ipv6", "socket-udp", "socket-tcp"] } -tokio-rustls = "0.24" -hyper-rustls = { version = "0.24", features = ["http1", "http2"] } - -serde = { version = "1.0", features=["derive"] } +serde = { version = "1", features=["derive"] } serde_yaml = "0.9" -serde_json = "1.0" -erased-serde = "0.4.5" - -hickory-client = "0.24" -hickory-resolver = "0.24" -hickory-server = { version = "0.24", features = ["dns-over-rustls", "dns-over-https-rustls"] } -hickory-proto = { version = "0.24", features = ["dns-over-rustls", "dns-over-https-rustls"]} - -# DoH -# ideally we should make a CryptoProvider with boringssl and get rid of rings -rustls = { version = "0.21", features=["dangerous_configuration", "quic"] } -rustls-pemfile = "1.0.4" -webpki-roots = "0.25" +serde_json = "1" +erased-serde = "0.4" + +# DNS +hickory-client = "0.25.0-alpha.2" +hickory-resolver = "0.25.0-alpha.2" +hickory-server = { version = "0.25.0-alpha.2", features = ["dns-over-rustls", "dns-over-https-rustls"] } +hickory-proto = { version = "0.25.0-alpha.2", features = ["dns-over-rustls", "dns-over-https-rustls"]} + + + dhcproto = "0.12" ring-compat = { version = "0.8", features = ["aead"] } rand = "0.8" -socket2 = { version = "0.5", features = ["all"] } -tokio-tungstenite = "0.23.1" + tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } tracing-oslog = { branch = "main", git = "https://github.com/Absolucy/tracing-oslog.git" } -tracing-appender = "0.2.3" +tracing-appender = "0.2" -shadowsocks = { version = "1.20.2", optional = true, features=["aead-cipher-2022","stream-cipher"] } -maxminddb = "0.24.0" -public-suffix = "0.1.0" -murmur3 = "0.5.2" +shadowsocks = { version = "1", optional = true, features=["aead-cipher-2022","stream-cipher"] } +maxminddb = "0.24" +public-suffix = "0.1" +murmur3 = "0.5" -arti-client = { version = "0.21.0", default-features = false, features = ["tokio", "rustls", "compression", "static-sqlite"] } -tor-rtcompat = { version = "0.21.0" } +arti-client = { version = "0.21", default-features = false, features = ["tokio", "rustls", "compression", "static-sqlite"] } +tor-rtcompat = { version = "0.21", default-features = false, features = ["rustls"] } # tuic -tuic = { rev = "82fab62", optional = true, git = "https://github.com/Itsusinn/tuic.git" } -tuic-quinn = { rev = "82fab62", optional = true, git = "https://github.com/Itsusinn/tuic.git" } -quinn = { version = "0.10", optional = true, default-features = false, features = ["futures-io", "runtime-tokio", "tls-rustls"] } -register-count = { version = "0.1.0", optional = true } +tuic = { tag = "v1.1.2-fix1", optional = true, git = "https://github.com/Itsusinn/tuic.git" } +tuic-quinn = { tag = "v1.1.2-fix1", optional = true, git = "https://github.com/Itsusinn/tuic.git" } +quinn = { version = "0.11", optional = true, default-features = false, features = ["futures-io", "runtime-tokio", "rustls"] } +register-count = { version = "0.1", optional = true } -console-subscriber = { version = "0.4.0" } -tracing-timing = { version = "0.6.0" } +console-subscriber = { version = "0.4" } +tracing-timing = { version = "0.6" } criterion = { version = "0.5", features = ["html_reports", "async_tokio"], optional = true } memory-stats = "1.0.0" diff --git a/clash_lib/src/app/api/handlers/dns.rs b/clash_lib/src/app/api/handlers/dns.rs index 08e2d3c84..93a26a63e 100644 --- a/clash_lib/src/app/api/handlers/dns.rs +++ b/clash_lib/src/app/api/handlers/dns.rs @@ -89,10 +89,7 @@ async fn query_dns( data.insert("name".to_owned(), rr.name().to_string().into()); data.insert("type".to_owned(), u16::from(rr.record_type()).into()); data.insert("ttl".to_owned(), rr.ttl().into()); - data.insert( - "data".to_owned(), - rr.data().map(|x| x.to_string()).unwrap_or_default().into(), - ); + data.insert("data".to_owned(), rr.data().to_string().into()); data.into() }; diff --git a/clash_lib/src/app/dispatcher/tracked.rs b/clash_lib/src/app/dispatcher/tracked.rs index 72ae8d4c7..5e6001ca9 100644 --- a/clash_lib/src/app/dispatcher/tracked.rs +++ b/clash_lib/src/app/dispatcher/tracked.rs @@ -2,7 +2,6 @@ use std::{fmt::Debug, pin::Pin, sync::Arc, task::Poll}; use async_trait::async_trait; use futures::{Sink, Stream}; -use hyper::client::connect::{Connected, Connection}; use tokio::{ io::{AsyncRead, AsyncWrite}, sync::oneshot::{error::TryRecvError, Receiver}, @@ -35,12 +34,6 @@ pub trait ChainedStream: async fn append_to_chain(&self, name: &str); } -impl Connection for BoxedChainedStream { - fn connected(&self) -> Connected { - Connected::new() - } -} - pub type BoxedChainedStream = Box; #[derive(Debug)] diff --git a/clash_lib/src/app/dns/config.rs b/clash_lib/src/app/dns/config.rs index 8e9183c78..7e7a53827 100644 --- a/clash_lib/src/app/dns/config.rs +++ b/clash_lib/src/app/dns/config.rs @@ -1,18 +1,17 @@ use std::{ collections::HashMap, fmt::Display, - io::BufReader, net::{IpAddr, SocketAddr}, sync::Arc, }; use ipnet::AddrParseError; use regex::Regex; -use rustls::{Certificate, PrivateKey}; +use rustls::pki_types::{CertificateDer, PrivateKeyDer}; use url::Url; use crate::{ - common::trie, + common::{trie, utils}, config::def::{DNSListen, DNSMode}, Error, }; @@ -48,18 +47,18 @@ pub struct FallbackFilter { pub domain: Vec, } -#[derive(Clone, Debug)] +#[derive(Debug)] pub struct DoHConfig { - pub certificate_and_key: (Vec, PrivateKey), + pub certificate_and_key: (Vec>, PrivateKeyDer<'static>), pub dns_hostname: Option, } -#[derive(Clone, Debug)] +#[derive(Debug)] pub struct DoTConfig { - pub certificate_and_key: (Vec, PrivateKey), + pub certificate_and_key: (Vec>, PrivateKeyDer<'static>), } -#[derive(Clone, Debug, Default)] +#[derive(Debug, Default)] pub struct DNSListenAddr { pub udp: Option, pub tcp: Option, @@ -271,6 +270,7 @@ impl TryFrom<&crate::config::def::Config> for Config { }) } DNSListen::Multiple(map) => { + use std::path::Path; let mut udp = None; let mut tcp = None; let mut doh = None; @@ -287,30 +287,14 @@ impl TryFrom<&crate::config::def::Config> for Config { "udp" => udp = Some(addr), "tcp" => tcp = Some(addr), "doh" => { - let mut buf_read: Box = - Box::new(BufReader::new( - TEST_CERT.as_bytes(), - )); - let certs = rustls_pemfile::certs(&mut buf_read) - .unwrap() - .into_iter() - .map(Certificate) - .collect::>(); - - let mut buf_read: Box = - Box::new(BufReader::new( - TEST_KEY.as_bytes(), - )); - let mut keys = - rustls_pemfile::pkcs8_private_keys( - &mut buf_read, - ) - .unwrap(); + let certs = + utils::load_cert_chain(Path::new(TEST_CERT)) + .unwrap(); + let priv_key = + utils::load_priv_key(Path::new(TEST_KEY)) + .unwrap(); let c = DoHConfig { - certificate_and_key: ( - certs, - PrivateKey(keys.remove(0)), - ), + certificate_and_key: (certs, priv_key), dns_hostname: Some( "dns.example.com".to_owned(), ), @@ -318,30 +302,14 @@ impl TryFrom<&crate::config::def::Config> for Config { doh = Some((addr, c)) } "dot" => { - let mut buf_read: Box = - Box::new(BufReader::new( - TEST_CERT.as_bytes(), - )); - let certs = rustls_pemfile::certs(&mut buf_read) - .unwrap() - .into_iter() - .map(Certificate) - .collect::>(); - - let mut buf_read: Box = - Box::new(BufReader::new( - TEST_KEY.as_bytes(), - )); - let mut keys = - rustls_pemfile::pkcs8_private_keys( - &mut buf_read, - ) - .unwrap(); + let certs = + utils::load_cert_chain(Path::new(TEST_CERT)) + .unwrap(); + let priv_key = + utils::load_priv_key(Path::new(TEST_KEY)) + .unwrap(); let c = DoTConfig { - certificate_and_key: ( - certs, - PrivateKey(keys.remove(0)), - ), + certificate_and_key: (certs, priv_key), }; dot = Some((addr, c)) } diff --git a/clash_lib/src/app/dns/dns_client.rs b/clash_lib/src/app/dns/dns_client.rs index 1efdc7d66..3fbd300aa 100644 --- a/clash_lib/src/app/dns/dns_client.rs +++ b/clash_lib/src/app/dns/dns_client.rs @@ -370,7 +370,6 @@ async fn dns_stream_builder( } DnsConfig::Tls(addr, host, iface) => { let mut tls_config = ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(GLOBAL_ROOT_STORE.clone()) .with_no_client_auth(); tls_config.alpn_protocols = vec!["dot".into()]; @@ -408,15 +407,14 @@ async fn dns_stream_builder( } DnsConfig::Https(addr, host, iface) => { let mut tls_config = ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(GLOBAL_ROOT_STORE.clone()) .with_no_client_auth(); tls_config.alpn_protocols = vec!["h2".into()]; if host == &addr.ip().to_string() { - tls_config - .dangerous() - .set_certificate_verifier(Arc::new(tls::NoHostnameTlsVerifier)); + tls_config.dangerous().set_certificate_verifier(Arc::new( + tls::NoHostnameTlsVerifier::new(), + )); } let fut = new_tcp_stream( diff --git a/clash_lib/src/app/dns/resolver/enhanced.rs b/clash_lib/src/app/dns/resolver/enhanced.rs index a79c97c07..218004adf 100644 --- a/clash_lib/src/app/dns/resolver/enhanced.rs +++ b/clash_lib/src/app/dns/resolver/enhanced.rs @@ -430,12 +430,9 @@ impl EnhancedResolver { || r.record_type() == rr::RecordType::AAAA }) .map(|r| match r.data() { - Some(data) => match data { - rr::RData::A(v4) => net::IpAddr::V4(**v4), - rr::RData::AAAA(v6) => net::IpAddr::V6(**v6), - _ => unreachable!("should be only A/AAAA"), - }, - None => unreachable!("should only be A/AAAA"), + rr::RData::A(v4) => net::IpAddr::V4(**v4), + rr::RData::AAAA(v6) => net::IpAddr::V6(**v6), + _ => unreachable!("should be only A/AAAA"), }) .collect() } diff --git a/clash_lib/src/app/remote_content_manager/http_client.rs b/clash_lib/src/app/remote_content_manager/http_client.rs index b0ccf2793..873b0fd6c 100644 --- a/clash_lib/src/app/remote_content_manager/http_client.rs +++ b/clash_lib/src/app/remote_content_manager/http_client.rs @@ -6,6 +6,7 @@ use std::{ use futures::Future; use hyper::Uri; +use hyper_util::client::legacy::connect::{Connected, Connection}; use tower::Service; use crate::{ @@ -55,3 +56,54 @@ impl Service for LocalConnector { Box::pin(async move { handler.connect_stream(&sess, resolver).await }) } } + +impl Connection for BoxedChainedStream { + fn connected(&self) -> Connected { + Connected::new() + } +} + +impl hyper::rt::Read for BoxedChainedStream { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + mut buf: hyper::rt::ReadBufCursor<'_>, + ) -> Poll> { + let n = unsafe { + let mut tbuf = tokio::io::ReadBuf::uninit(buf.as_mut()); + match tokio::io::AsyncRead::poll_read(self, cx, &mut tbuf) { + Poll::Ready(Ok(())) => tbuf.filled().len(), + other => return other, + } + }; + + unsafe { + buf.advance(n); + } + Poll::Ready(Ok(())) + } +} + +impl hyper::rt::Write for BoxedChainedStream { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + tokio::io::AsyncWrite::poll_write(self, cx, buf) + } + + fn poll_flush( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + tokio::io::AsyncWrite::poll_flush(self, cx) + } + + fn poll_shutdown( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + tokio::io::AsyncWrite::poll_shutdown(self, cx) + } +} diff --git a/clash_lib/src/app/remote_content_manager/mod.rs b/clash_lib/src/app/remote_content_manager/mod.rs index 53a3353a4..b4e921f5f 100644 --- a/clash_lib/src/app/remote_content_manager/mod.rs +++ b/clash_lib/src/app/remote_content_manager/mod.rs @@ -7,10 +7,13 @@ use std::{ time::Duration, }; +use bytes::Bytes; use chrono::{DateTime, Utc}; use futures::{stream::FuturesUnordered, StreamExt}; +use http_body_util::Empty; use hyper::Request; +use hyper_util::{client::legacy::Client, rt::TokioExecutor}; use serde::Serialize; use tokio::sync::RwLock; use tracing::{debug, instrument, trace}; @@ -141,7 +144,6 @@ impl ProxyManager { use crate::common::tls::GLOBAL_ROOT_STORE; let mut tls_config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(GLOBAL_ROOT_STORE.clone()) .with_no_client_auth(); @@ -158,12 +160,14 @@ impl ProxyManager { connector.clone() }; - let client = hyper::Client::builder().build::<_, hyper::Body>(connector); + // Build the hyper client from the HTTPS connector. + let client: Client<_, Empty> = + Client::builder(TokioExecutor::new()).build(connector); let req = Request::get(url) .header("Connection", "Close") .version(hyper::Version::HTTP_11) - .body(hyper::Body::empty()) + .body(Empty::new()) .unwrap(); let resp = TimedFuture::new(client.request(req), None); @@ -204,7 +208,7 @@ impl ProxyManager { let req2 = Request::get(url) .header("Connection", "Close") .version(hyper::Version::HTTP_11) - .body(hyper::Body::empty()) + .body(Empty::new()) .unwrap(); let resp2 = TimedFuture::new(client.request(req2), None); diff --git a/clash_lib/src/app/remote_content_manager/providers/http_vehicle.rs b/clash_lib/src/app/remote_content_manager/providers/http_vehicle.rs index f63f01a34..f0e2168b3 100644 --- a/clash_lib/src/app/remote_content_manager/providers/http_vehicle.rs +++ b/clash_lib/src/app/remote_content_manager/providers/http_vehicle.rs @@ -9,7 +9,8 @@ use crate::{ use async_trait::async_trait; -use hyper::{body, Uri}; +use http_body_util::BodyExt; +use hyper::Uri; use std::io; @@ -44,15 +45,15 @@ impl Vehicle { #[async_trait] impl ProviderVehicle for Vehicle { async fn read(&self) -> std::io::Result> { - body::to_bytes( - self.http_client - .get(self.url.clone()) - .await - .map_err(|x| io::Error::new(io::ErrorKind::Other, x.to_string()))?, - ) - .await - .map_err(map_io_error) - .map(|x| x.into_iter().collect::>()) + self.http_client + .get(self.url.clone()) + .await + .map_err(|x| io::Error::new(io::ErrorKind::Other, x.to_string()))? + .into_body() + .collect() + .await + .map(|x| x.to_bytes().to_vec()) + .map_err(map_io_error) } fn path(&self) -> &str { diff --git a/clash_lib/src/app/router/mod.rs b/clash_lib/src/app/router/mod.rs index f9b1bae2a..aa40a211c 100644 --- a/clash_lib/src/app/router/mod.rs +++ b/clash_lib/src/app/router/mod.rs @@ -81,9 +81,9 @@ impl Router { } } - pub async fn match_route<'a>( - &'a self, - sess: &'a Session, + pub async fn match_route( + &self, + sess: &Session, ) -> (&str, Option<&Box>) { let mut sess_resolved = false; let mut sess_dup = sess.clone(); diff --git a/clash_lib/src/app/router/rules/geodata/str_matcher.rs b/clash_lib/src/app/router/rules/geodata/str_matcher.rs index 3958ec036..0b2e91526 100644 --- a/clash_lib/src/app/router/rules/geodata/str_matcher.rs +++ b/clash_lib/src/app/router/rules/geodata/str_matcher.rs @@ -70,22 +70,22 @@ mod tests { #[test] fn test_matchers() { let full_matcher = FullMatcher("https://google.com".to_string()); - assert_eq!(full_matcher.matches("https://google.com"), true); - assert_eq!(full_matcher.matches("https://www.google.com"), false); + assert!(full_matcher.matches("https://google.com")); + assert!(!full_matcher.matches("https://www.google.com")); let sub_str_matcher = SubStrMatcher("google".to_string()); - assert_eq!(sub_str_matcher.matches("https://www.google.com"), true); - assert_eq!(sub_str_matcher.matches("https://www.youtube.com"), false); + assert!(sub_str_matcher.matches("https://www.google.com")); + assert!(!sub_str_matcher.matches("https://www.youtube.com")); let domain_matcher = DomainMatcher("google.com".to_string()); - assert_eq!(domain_matcher.matches("https://www.google.com"), true); - assert_eq!(domain_matcher.matches("https://www.fakegoogle.com"), false); - assert_eq!(domain_matcher.matches("https://wwwgoogle.com"), false); + assert!(domain_matcher.matches("https://www.google.com")); + assert!(!domain_matcher.matches("https://www.fakegoogle.com")); + assert!(!domain_matcher.matches("https://wwwgoogle.com")); let regex_matcher = RegexMatcher(regex::Regex::new(r".*google\..*").unwrap()); - assert_eq!(regex_matcher.matches("https://www.google.com"), true); - assert_eq!(regex_matcher.matches("https://www.fakegoogle.com"), true); - assert_eq!(regex_matcher.matches("https://goo.gle.com"), false); + assert!(regex_matcher.matches("https://www.google.com")); + assert!(regex_matcher.matches("https://www.fakegoogle.com")); + assert!(!regex_matcher.matches("https://goo.gle.com")); } } diff --git a/clash_lib/src/common/geodata/mod.rs b/clash_lib/src/common/geodata/mod.rs index 319e2d949..dc19c4b04 100644 --- a/clash_lib/src/common/geodata/mod.rs +++ b/clash_lib/src/common/geodata/mod.rs @@ -1,11 +1,10 @@ -use crate::{ - common::{http::HttpClient, utils::download}, - Error, -}; +use crate::{common::utils::download, Error}; use prost::Message; use std::path::Path; use tracing::{debug, info}; +use super::http::HttpClient; + pub(crate) mod geodata_proto { include!(concat!(env!("OUT_DIR"), "/geodata.rs")); } diff --git a/clash_lib/src/common/http.rs b/clash_lib/src/common/http/client.rs similarity index 55% rename from clash_lib/src/common/http.rs rename to clash_lib/src/common/http/client.rs index 4c22e3ce4..571e08c38 100644 --- a/clash_lib/src/common/http.rs +++ b/clash_lib/src/common/http/client.rs @@ -1,18 +1,26 @@ use std::{ pin::Pin, + sync::Arc, task::{Context, Poll}, }; +use bytes::Bytes; use futures::Future; -use hyper::{ - client::connect::{Connected, Connection}, - Uri, +use http_body_util::Empty; +use hyper::Uri; +use hyper_util::{ + client::legacy::{ + connect::{Connected, Connection}, + Client, + }, + rt::TokioExecutor, }; use tower::Service; use crate::{ app::dns::ThreadSafeDNSResolver, + common::tls::GLOBAL_ROOT_STORE, proxy::{utils::new_tcp_stream, AnyStream}, }; @@ -74,28 +82,70 @@ impl Connection for AnyStream { } } -pub type HttpClient = hyper::Client>; +impl hyper::rt::Read for AnyStream { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + mut buf: hyper::rt::ReadBufCursor<'_>, + ) -> Poll> { + let n = unsafe { + let mut tbuf = tokio::io::ReadBuf::uninit(buf.as_mut()); + match tokio::io::AsyncRead::poll_read(self, cx, &mut tbuf) { + Poll::Ready(Ok(())) => tbuf.filled().len(), + other => return other, + } + }; + + unsafe { + buf.advance(n); + } + Poll::Ready(Ok(())) + } +} -pub fn new_http_client( - dns_resolver: ThreadSafeDNSResolver, -) -> std::io::Result { - use std::sync::Arc; +impl hyper::rt::Write for AnyStream { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + tokio::io::AsyncWrite::poll_write(self, cx, buf) + } - use super::tls::GLOBAL_ROOT_STORE; + fn poll_flush( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + tokio::io::AsyncWrite::poll_flush(self, cx) + } - let connector = LocalConnector(dns_resolver); + fn poll_shutdown( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + tokio::io::AsyncWrite::poll_shutdown(self, cx) + } +} +pub type HttpClient = + Client, Empty>; + +pub fn new_http_client( + dns_resolver: ThreadSafeDNSResolver, +) -> std::io::Result { let mut tls_config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(GLOBAL_ROOT_STORE.clone()) .with_no_client_auth(); tls_config.key_log = Arc::new(rustls::KeyLogFile::new()); - let connector = hyper_rustls::HttpsConnectorBuilder::new() - .with_tls_config(tls_config) - .https_or_http() - .enable_all_versions() - .wrap_connector(connector); + let connector = LocalConnector(dns_resolver); + + let connector: hyper_rustls::HttpsConnector = + hyper_rustls::HttpsConnectorBuilder::new() + .with_tls_config(tls_config) + .https_or_http() + .enable_all_versions() + .wrap_connector(connector); - Ok(hyper::Client::builder().build::<_, hyper::Body>(connector)) + Ok(Client::builder(TokioExecutor::new()).build(connector)) } diff --git a/clash_lib/src/common/http/hyper/mod.rs b/clash_lib/src/common/http/hyper/mod.rs new file mode 100644 index 000000000..d7b479c54 --- /dev/null +++ b/clash_lib/src/common/http/hyper/mod.rs @@ -0,0 +1,190 @@ +use std::{ + pin::Pin, + task::{Context, Poll}, +}; + +use bytes::Bytes; +use http_body_util::combinators::BoxBody; + +pub type HyperResponseBody = BoxBody; + +/// https://github.com/hyperium/hyper/blob/67a4a498d8bbdce4e604bc578da4693fb048f83d/benches/support/tokiort.rs#L86 +#[derive(Debug)] +pub struct TokioIo { + inner: T, +} + +impl TokioIo { + pub fn new(inner: T) -> Self { + Self { inner } + } + + #[allow(dead_code)] + pub fn inner(self) -> T { + self.inner + } +} + +impl hyper::rt::Read for TokioIo +where + T: tokio::io::AsyncRead + Unpin, +{ + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + mut buf: hyper::rt::ReadBufCursor<'_>, + ) -> Poll> { + let pin = self.get_mut(); + let n = unsafe { + let mut tbuf = tokio::io::ReadBuf::uninit(buf.as_mut()); + match tokio::io::AsyncRead::poll_read( + std::pin::Pin::new(&mut pin.inner), + cx, + &mut tbuf, + ) { + Poll::Ready(Ok(())) => tbuf.filled().len(), + other => return other, + } + }; + + unsafe { + buf.advance(n); + } + Poll::Ready(Ok(())) + } +} + +impl hyper::rt::Write for TokioIo +where + T: tokio::io::AsyncWrite + Unpin, +{ + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + let pin = self.get_mut(); + tokio::io::AsyncWrite::poll_write( + std::pin::Pin::new(&mut pin.inner), + cx, + buf, + ) + } + + fn poll_flush( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + let pin = self.get_mut(); + tokio::io::AsyncWrite::poll_flush(std::pin::Pin::new(&mut pin.inner), cx) + } + + fn poll_shutdown( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + let pin = self.get_mut(); + tokio::io::AsyncWrite::poll_shutdown(std::pin::Pin::new(&mut pin.inner), cx) + } + + fn is_write_vectored(&self) -> bool { + tokio::io::AsyncWrite::is_write_vectored(&self.inner) + } + + fn poll_write_vectored( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + bufs: &[std::io::IoSlice<'_>], + ) -> Poll> { + let pin: &mut TokioIo = self.get_mut(); + tokio::io::AsyncWrite::poll_write_vectored( + std::pin::Pin::new(&mut pin.inner), + cx, + bufs, + ) + } +} + +impl tokio::io::AsyncRead for TokioIo +where + T: hyper::rt::Read + Unpin, +{ + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + tbuf: &mut tokio::io::ReadBuf<'_>, + ) -> Poll> { + let pin: &mut TokioIo = self.get_mut(); + + let filled = tbuf.filled().len(); + let sub_filled = unsafe { + let mut buf = hyper::rt::ReadBuf::uninit(tbuf.unfilled_mut()); + + match hyper::rt::Read::poll_read( + std::pin::Pin::new(&mut pin.inner), + cx, + buf.unfilled(), + ) { + Poll::Ready(Ok(())) => buf.filled().len(), + other => return other, + } + }; + + let n_filled = filled + sub_filled; + // At least sub_filled bytes had to have been initialized. + let n_init = sub_filled; + unsafe { + tbuf.assume_init(n_init); + tbuf.set_filled(n_filled); + } + + Poll::Ready(Ok(())) + } +} + +impl tokio::io::AsyncWrite for TokioIo +where + T: hyper::rt::Write + Unpin, +{ + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + let pin: &mut TokioIo = self.get_mut(); + hyper::rt::Write::poll_write(std::pin::Pin::new(&mut pin.inner), cx, buf) + } + + fn poll_flush( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + let pin: &mut TokioIo = self.get_mut(); + hyper::rt::Write::poll_flush(std::pin::Pin::new(&mut pin.inner), cx) + } + + fn poll_shutdown( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + let pin: &mut TokioIo = self.get_mut(); + hyper::rt::Write::poll_shutdown(std::pin::Pin::new(&mut pin.inner), cx) + } + + fn is_write_vectored(&self) -> bool { + hyper::rt::Write::is_write_vectored(&self.inner) + } + + fn poll_write_vectored( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + bufs: &[std::io::IoSlice<'_>], + ) -> Poll> { + let pin: &mut TokioIo = self.get_mut(); + hyper::rt::Write::poll_write_vectored( + std::pin::Pin::new(&mut pin.inner), + cx, + bufs, + ) + } +} diff --git a/clash_lib/src/common/http/mod.rs b/clash_lib/src/common/http/mod.rs new file mode 100644 index 000000000..c72a6d370 --- /dev/null +++ b/clash_lib/src/common/http/mod.rs @@ -0,0 +1,5 @@ +pub mod client; +pub mod hyper; + +pub use client::*; +pub use hyper::HyperResponseBody; diff --git a/clash_lib/src/common/mmdb.rs b/clash_lib/src/common/mmdb.rs index 1a97fb594..5c9515fe6 100644 --- a/clash_lib/src/common/mmdb.rs +++ b/clash_lib/src/common/mmdb.rs @@ -4,10 +4,12 @@ use maxminddb::geoip2; use tracing::{debug, info, warn}; use crate::{ - common::{errors::map_io_error, http::HttpClient, utils::download}, + common::{errors::map_io_error, utils::download}, Error, }; +use super::http::HttpClient; + pub struct Mmdb { reader: maxminddb::Reader>, } diff --git a/clash_lib/src/common/tls.rs b/clash_lib/src/common/tls.rs index f3a7cf7a0..e3e91de7a 100644 --- a/clash_lib/src/common/tls.rs +++ b/clash_lib/src/common/tls.rs @@ -1,86 +1,96 @@ use once_cell::sync::Lazy; use rustls::{ - client::{ - HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier, - WebPkiVerifier, - }, - DigitallySignedStruct, OwnedTrustAnchor, RootCertStore, + client::{danger::ServerCertVerifier, WebPkiServerVerifier}, + pki_types::{CertificateDer, ServerName, UnixTime}, + RootCertStore, }; use tracing::warn; -use rustls::{Certificate, ServerName}; -use std::{sync::Arc, time::SystemTime}; +use std::sync::Arc; pub static GLOBAL_ROOT_STORE: Lazy> = Lazy::new(global_root_store); fn global_root_store() -> Arc { - let mut root_store = RootCertStore::empty(); - root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) - })); - + let root_store = webpki_roots::TLS_SERVER_ROOTS.iter().cloned().collect(); Arc::new(root_store) } /// Warning: NO validation on certs. -pub struct DummyTlsVerifier; +#[derive(Debug)] +pub struct DummyTlsVerifier(Arc); + +impl DummyTlsVerifier { + pub fn new() -> Self { + Self( + WebPkiServerVerifier::builder(GLOBAL_ROOT_STORE.clone()) + .build() + .unwrap(), + ) + } +} -impl ServerCertVerifier for DummyTlsVerifier { +impl rustls::client::danger::ServerCertVerifier for DummyTlsVerifier { fn verify_server_cert( &self, - _end_entity: &Certificate, - _intermediates: &[Certificate], - _server_name: &ServerName, - _scts: &mut dyn Iterator, - _ocsp_response: &[u8], - _now: SystemTime, - ) -> Result { - Ok(ServerCertVerified::assertion()) + _end_entity: &CertificateDer<'_>, + _intermediates: &[CertificateDer<'_>], + _server_name: &ServerName<'_>, + _ocsp: &[u8], + _now: UnixTime, + ) -> Result { + Ok(rustls::client::danger::ServerCertVerified::assertion()) } fn verify_tls12_signature( &self, _message: &[u8], - _cert: &Certificate, - _dss: &DigitallySignedStruct, - ) -> Result { - Ok(HandshakeSignatureValid::assertion()) + _cert: &CertificateDer<'_>, + _dss: &rustls::DigitallySignedStruct, + ) -> Result { + Ok(rustls::client::danger::HandshakeSignatureValid::assertion()) } fn verify_tls13_signature( &self, _message: &[u8], - _cert: &Certificate, - _dss: &DigitallySignedStruct, - ) -> Result { - Ok(HandshakeSignatureValid::assertion()) + _cert: &CertificateDer<'_>, + _dss: &rustls::DigitallySignedStruct, + ) -> Result { + Ok(rustls::client::danger::HandshakeSignatureValid::assertion()) + } + + fn supported_verify_schemes(&self) -> Vec { + self.0.supported_verify_schemes() } } -pub struct NoHostnameTlsVerifier; +#[derive(Debug)] +pub struct NoHostnameTlsVerifier(Arc); + +impl NoHostnameTlsVerifier { + pub fn new() -> Self { + Self( + WebPkiServerVerifier::builder(GLOBAL_ROOT_STORE.clone()) + .build() + .unwrap(), + ) + } +} impl ServerCertVerifier for NoHostnameTlsVerifier { fn verify_server_cert( &self, - end_entity: &Certificate, - intermediates: &[Certificate], - server_name: &ServerName, - scts: &mut dyn Iterator, + end_entity: &CertificateDer<'_>, + intermediates: &[CertificateDer<'_>], + server_name: &ServerName<'_>, ocsp_response: &[u8], - now: SystemTime, - ) -> Result { - let verifier = - WebPkiVerifier::new(rustls::RootCertStore { roots: vec![] }, None); - match verifier.verify_server_cert( + now: UnixTime, + ) -> Result { + match self.0.verify_server_cert( end_entity, intermediates, server_name, - scts, ocsp_response, now, ) { @@ -89,9 +99,31 @@ impl ServerCertVerifier for NoHostnameTlsVerifier { "skipping TLS cert name verification for server name: {:?}", server_name ); - Ok(ServerCertVerified::assertion()) + Ok(rustls::client::danger::ServerCertVerified::assertion()) } other => other, } } + + fn verify_tls12_signature( + &self, + message: &[u8], + cert: &CertificateDer<'_>, + dss: &rustls::DigitallySignedStruct, + ) -> Result { + self.0.verify_tls12_signature(message, cert, dss) + } + + fn verify_tls13_signature( + &self, + message: &[u8], + cert: &CertificateDer<'_>, + dss: &rustls::DigitallySignedStruct, + ) -> Result { + self.0.verify_tls13_signature(message, cert, dss) + } + + fn supported_verify_schemes(&self) -> Vec { + self.0.supported_verify_schemes() + } } diff --git a/clash_lib/src/common/utils.rs b/clash_lib/src/common/utils.rs index a2af5e30e..f8bf9d961 100644 --- a/clash_lib/src/common/utils.rs +++ b/clash_lib/src/common/utils.rs @@ -1,11 +1,9 @@ use async_recursion::async_recursion; -use hyper::body::HttpBody; +use futures::StreamExt; +use http_body_util::BodyDataStream; use std::{fmt::Write, num::ParseIntError, path::Path}; -use crate::{ - common::{errors::new_io_error, http::HttpClient}, - Error, -}; +use crate::{common::errors::new_io_error, Error}; use rand::{ distributions::uniform::{SampleRange, SampleUniform}, Fill, Rng, @@ -79,7 +77,7 @@ where let uri = url.parse::()?; let mut out = std::fs::File::create(&path)?; - let mut res = http_client.get(uri).await?; + let res = http_client.get(uri).await?; if res.status().is_redirection() { return download( @@ -105,9 +103,43 @@ where debug!("downloading data to {}", path.as_ref().to_string_lossy()); - while let Some(chunk) = res.body_mut().data().await { + let mut stream = BodyDataStream::new(res.into_body()); + while let Some(chunk) = stream.next().await { out.write_all(&chunk?)?; } Ok(()) } + +use anyhow::Context; +use rustls::pki_types::{CertificateDer, PrivateKeyDer, PrivatePkcs8KeyDer}; +use std::fs; + +use super::http::HttpClient; + +pub fn load_cert_chain( + cert_path: &Path, +) -> anyhow::Result>> { + let cert_chain = + fs::read(cert_path).context("failed to read certificate chain")?; + let cert_chain = if cert_path.extension().map_or(false, |x| x == "der") { + vec![CertificateDer::from(cert_chain)] + } else { + rustls_pemfile::certs(&mut &*cert_chain) + .collect::>() + .context("invalid PEM-encoded certificate")? + }; + Ok(cert_chain) +} + +pub fn load_priv_key(key_path: &Path) -> anyhow::Result> { + let key = fs::read(key_path).context("failed to read private key")?; + let key = if key_path.extension().map_or(false, |x| x == "der") { + PrivateKeyDer::Pkcs8(PrivatePkcs8KeyDer::from(key)) + } else { + rustls_pemfile::private_key(&mut &*key) + .context("malformed PKCS #1 private key")? + .ok_or_else(|| anyhow::Error::msg("no private keys found"))? + }; + Ok(key) +} diff --git a/clash_lib/src/config/def.rs b/clash_lib/src/config/def.rs index b4a0d59a2..57d5e4d74 100644 --- a/clash_lib/src/config/def.rs +++ b/clash_lib/src/config/def.rs @@ -1022,7 +1022,7 @@ rules: .unwrap() .as_mapping() .unwrap() - .get(&Value::String("mode".into())) + .get(Value::String("mode".into())) .unwrap() .as_str(), Some("websocket") diff --git a/clash_lib/src/proxy/http/inbound/auth.rs b/clash_lib/src/proxy/http/inbound/auth.rs index 62b2dfe53..ac2e699ca 100644 --- a/clash_lib/src/proxy/http/inbound/auth.rs +++ b/clash_lib/src/proxy/http/inbound/auth.rs @@ -1,11 +1,16 @@ use base64::Engine; -use hyper::{Body, Request, Response}; +use http_body_util::{BodyExt, Full}; +use hyper::{Request, Response}; use tracing::warn; -use crate::common::auth::ThreadSafeAuthenticator; +use crate::common::{ + auth::ThreadSafeAuthenticator, errors::map_io_error, http::HyperResponseBody, +}; -fn parse_basic_proxy_authorization(req: &Request) -> Option<&str> { +fn parse_basic_proxy_authorization( + req: &Request, +) -> Option<&str> { req.headers() .get(hyper::header::PROXY_AUTHORIZATION) .map(|v| v.to_str().unwrap_or_default()) @@ -26,13 +31,17 @@ fn decode_basic_proxy_authorization(cred: &str) -> Option<(String, String)> { /// returns a auth required response on auth failure pub fn authenticate_req( - req: &Request, + req: &Request, authenticator: ThreadSafeAuthenticator, -) -> Option> { +) -> Option> { let auth_resp = Response::builder() .status(hyper::StatusCode::PROXY_AUTHENTICATION_REQUIRED) .header(hyper::header::PROXY_AUTHENTICATE, "Basic") - .body("Proxy Auth Required".into()) + .body( + Full::new("Proxy Auth Required".into()) + .map_err(map_io_error) + .boxed(), + ) .unwrap(); let cred = parse_basic_proxy_authorization(req); if cred.is_none() { diff --git a/clash_lib/src/proxy/http/inbound/proxy.rs b/clash_lib/src/proxy/http/inbound/proxy.rs index 2e1be85e1..40ed6669a 100644 --- a/clash_lib/src/proxy/http/inbound/proxy.rs +++ b/clash_lib/src/proxy/http/inbound/proxy.rs @@ -5,14 +5,19 @@ use std::{ use futures::{future::BoxFuture, TryFutureExt}; -use hyper::{server::conn::Http, Body, Client, Method, Request, Response, Uri}; +use http_body_util::{BodyExt, Empty, Full}; +use hyper::{body::Incoming, server::conn::http1, Method, Request, Response, Uri}; -use tower::Service; +use hyper_util::{client::legacy::Client, rt::TokioExecutor}; use tracing::{instrument, warn}; use crate::{ app::dispatcher::Dispatcher, - common::auth::ThreadSafeAuthenticator, + common::{ + auth::ThreadSafeAuthenticator, + errors::map_io_error, + http::{hyper::TokioIo, HyperResponseBody}, + }, proxy::{AnyStream, ProxyError}, session::{Network, Session, SocksAddr, Type}, }; @@ -38,18 +43,18 @@ pub fn maybe_socks_addr(r: &Uri) -> Option { } async fn proxy( - req: Request, + req: Request, src: SocketAddr, dispatcher: Arc, authenticator: ThreadSafeAuthenticator, -) -> Result, ProxyError> { +) -> Result, ProxyError> { if authenticator.enabled() { if let Some(res) = authenticate_req(&req, authenticator) { return Ok(res); } } - let client = Client::builder() + let client = Client::builder(TokioExecutor::new()) .http1_title_case_headers(true) .http1_preserve_header_case(true) .build(Connector::new(src, dispatcher.clone())); @@ -69,17 +74,23 @@ async fn proxy( ..Default::default() }; - dispatcher.dispatch_stream(sess, upgraded).await + dispatcher + .dispatch_stream(sess, TokioIo::new(upgraded)) + .await } Err(e) => warn!("HTTP handshake failure, {}", e), } }); - Ok(Response::new(Body::empty())) + Ok(Response::new(Empty::new().map_err(map_io_error).boxed())) } else { Ok(Response::builder() .status(hyper::StatusCode::BAD_REQUEST) - .body(format!("invalid request uri: {}", req.uri()).into()) + .body( + Full::new(format!("invalid request uri: {}", req.uri()).into()) + .map_err(map_io_error) + .boxed(), + ) .unwrap()) } } else { @@ -88,12 +99,12 @@ async fn proxy( .map_err(|x| ProxyError::General(x.to_string())) .await { - Ok(res) => Ok(res), + Ok(res) => Ok(res.map(|b| b.map_err(map_io_error).boxed())), Err(e) => { warn!("http proxy error: {}", e); Ok(Response::builder() .status(hyper::StatusCode::BAD_GATEWAY) - .body(Body::empty()) + .body(Empty::new().map_err(map_io_error).boxed()) .unwrap()) } } @@ -106,19 +117,12 @@ struct ProxyService { authenticator: ThreadSafeAuthenticator, } -impl Service> for ProxyService { +impl hyper::service::Service> for ProxyService { type Error = ProxyError; type Future = BoxFuture<'static, Result>; - type Response = Response; + type Response = Response; - fn poll_ready( - &mut self, - _: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - std::task::Poll::Ready(Ok(())) - } - - fn call(&mut self, req: Request) -> Self::Future { + fn call(&self, req: Request) -> Self::Future { Box::pin(proxy( req, self.src, @@ -136,9 +140,9 @@ pub async fn handle( authenticator: ThreadSafeAuthenticator, ) { tokio::task::spawn(async move { - if let Err(http_err) = Http::new() - .http1_only(true) - .http1_keep_alive(true) + if let Err(http_err) = http1::Builder::new() + .preserve_header_case(true) + .title_case_headers(true) .serve_connection( stream, ProxyService { diff --git a/clash_lib/src/proxy/shadowsocks/mod.rs b/clash_lib/src/proxy/shadowsocks/mod.rs index 35bbffe40..ad2698224 100644 --- a/clash_lib/src/proxy/shadowsocks/mod.rs +++ b/clash_lib/src/proxy/shadowsocks/mod.rs @@ -223,7 +223,7 @@ impl OutboundHandler for Handler { ) .await?; - let socket = + let socket: ProxySocket = ProxySocket::from_socket(UdpSocketType::Client, ctx, &cfg, socket); let d = OutboundDatagramShadowsocks::new( socket, @@ -394,7 +394,7 @@ mod tests { "-p", &port, "--obfs", - &mode, + mode, "-r", &ss_server_env, ]) @@ -423,7 +423,7 @@ mod tests { let mut chained = MultiDockerTestRunner::default(); chained.add(get_ss_runner(ss_port)).await; chained.add(get_obfs_runner(ss_port, obfs_port, mode)).await; - run_test_suites_and_cleanup(handler, chained, &Suite::tcp_tests()).await + run_test_suites_and_cleanup(handler, chained, Suite::tcp_tests()).await } #[tokio::test] diff --git a/clash_lib/src/proxy/shadowsocks/shadow_tls/connector.rs b/clash_lib/src/proxy/shadowsocks/shadow_tls/connector.rs index 7d9fc71f7..909265e04 100644 --- a/clash_lib/src/proxy/shadowsocks/shadow_tls/connector.rs +++ b/clash_lib/src/proxy/shadowsocks/shadow_tls/connector.rs @@ -30,7 +30,6 @@ impl Connector { use crate::common::tls::GLOBAL_ROOT_STORE; let tls_config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(GLOBAL_ROOT_STORE.clone()) .with_no_client_auth(); @@ -44,7 +43,7 @@ impl Connector { let proxy_stream = ProxyTlsStream::new(stream, &opts.password); let hamc_handshake = Hmac::new(&opts.password, (&[], &[])); - let sni_name = rustls::ServerName::try_from(opts.host.as_str()) + let sni_name = rustls::pki_types::ServerName::try_from(opts.host.clone()) .unwrap_or_else(|_| panic!("invalid server name: {}", opts.host)); let session_id_generator = move |data: &_| generate_session_id(&hamc_handshake, data); diff --git a/clash_lib/src/proxy/socks/outbound/mod.rs b/clash_lib/src/proxy/socks/outbound/mod.rs index 087a94791..f0b2497f0 100644 --- a/clash_lib/src/proxy/socks/outbound/mod.rs +++ b/clash_lib/src/proxy/socks/outbound/mod.rs @@ -304,7 +304,7 @@ mod tests { let host = format!("0.0.0.0:{}", port); let username = username.unwrap_or_default(); let password = password.unwrap_or_default(); - let cmd = if username != "" && password != "" { + let cmd = if !username.is_empty() && !password.is_empty() { vec![ "-a", &host, diff --git a/clash_lib/src/proxy/transport/tls.rs b/clash_lib/src/proxy/transport/tls.rs index 8f44990a9..608be1439 100644 --- a/clash_lib/src/proxy/transport/tls.rs +++ b/clash_lib/src/proxy/transport/tls.rs @@ -21,7 +21,6 @@ pub async fn wrap_stream( use crate::common::tls::{self, GLOBAL_ROOT_STORE}; let mut tls_config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(GLOBAL_ROOT_STORE.clone()) .with_no_client_auth(); tls_config.alpn_protocols = opt @@ -34,14 +33,15 @@ pub async fn wrap_stream( if opt.skip_cert_verify { tls_config .dangerous() - .set_certificate_verifier(Arc::new(tls::DummyTlsVerifier {})); + .set_certificate_verifier(Arc::new(tls::DummyTlsVerifier::new())); } tls_config.key_log = Arc::new(rustls::KeyLogFile::new()); let connector = tokio_rustls::TlsConnector::from(Arc::new(tls_config)); - let dns_name = rustls::ServerName::try_from(opt.sni.as_str()) - .unwrap_or_else(|_| panic!("invalid server name: {}", opt.sni)); + let dns_name = + rustls::pki_types::ServerName::try_from(opt.sni.as_str().to_owned()) + .unwrap_or_else(|_| panic!("invalid server name: {}", opt.sni)); let c = connector.connect(dns_name, stream).await.and_then(|x| { if let Some(expected_alpn) = expected_alpn { diff --git a/clash_lib/src/proxy/tuic/mod.rs b/clash_lib/src/proxy/tuic/mod.rs index ba2965cae..b532149fe 100644 --- a/clash_lib/src/proxy/tuic/mod.rs +++ b/clash_lib/src/proxy/tuic/mod.rs @@ -9,6 +9,7 @@ use axum::async_trait; use quinn::{ congestion::{BbrConfig, NewRenoConfig}, + crypto::rustls::QuicClientConfig, EndpointConfig, TokioRuntime, }; use tracing::debug; @@ -165,20 +166,19 @@ impl Handler { opts: HandlerOptions, resolver: ThreadSafeDNSResolver, ) -> Result { - let mut crypto = TlsConfig::builder() - .with_safe_default_cipher_suites() - .with_safe_default_kx_groups() - .with_protocol_versions(&[&rustls::version::TLS13]) - .unwrap() - .with_root_certificates(GLOBAL_ROOT_STORE.clone()) - .with_no_client_auth(); + let mut crypto = + TlsConfig::builder_with_protocol_versions(&[&rustls::version::TLS13]) + .with_root_certificates(GLOBAL_ROOT_STORE.clone()) + .with_no_client_auth(); // TODO(error-handling) if alpn not match the following error will be // throw: aborted by peer: the cryptographic handshake failed: error // 120: peer doesn't support any known protocol crypto.alpn_protocols.clone_from(&opts.alpn); crypto.enable_early_data = true; crypto.enable_sni = !opts.disable_sni; - let mut quinn_config = QuinnConfig::new(Arc::new(crypto)); + + let mut quinn_config = + QuinnConfig::new(Arc::new(QuicClientConfig::try_from(crypto)?)); let mut transport_config = QuinnTransportConfig::default(); transport_config .max_concurrent_bidi_streams(opts.max_open_stream) diff --git a/clash_lib/src/proxy/utils/test_utils/docker_runner.rs b/clash_lib/src/proxy/utils/test_utils/docker_runner.rs index c30b05ccd..3e9b583dc 100644 --- a/clash_lib/src/proxy/utils/test_utils/docker_runner.rs +++ b/clash_lib/src/proxy/utils/test_utils/docker_runner.rs @@ -256,7 +256,7 @@ impl DockerTestRunnerBuilder { pub fn sysctls(mut self, sysctls: &[(&str, &str)]) -> Self { self.host_config.sysctls = Some( sysctls - .into_iter() + .iter() .map(|(k, v)| (k.to_string(), v.to_string())) .collect::>(), ); diff --git a/clash_lib/src/proxy/utils/test_utils/mod.rs b/clash_lib/src/proxy/utils/test_utils/mod.rs index dda86d87b..cbab50b12 100644 --- a/clash_lib/src/proxy/utils/test_utils/mod.rs +++ b/clash_lib/src/proxy/utils/test_utils/mod.rs @@ -266,7 +266,7 @@ pub async fn dns_test(handler: Arc) -> anyhow::Result<()> { continue; } let pkt = pkt.unwrap(); - assert!(pkt.data.len() > 0); + assert!(!pkt.data.is_empty()); let end_time = Instant::now(); tracing::debug!( "dns test time cost:{:?}", diff --git a/clash_lib/src/proxy/wg/device.rs b/clash_lib/src/proxy/wg/device.rs index 1bb1e0b35..3e401c71f 100644 --- a/clash_lib/src/proxy/wg/device.rs +++ b/clash_lib/src/proxy/wg/device.rs @@ -192,36 +192,34 @@ impl DeviceManager { trace!("got dns response: {:?}", msg); for ans in msg.answers().iter() { if ans.record_type() == rtype { - if let Some(data) = ans.data() { - match (rtype, data) { - (_, hickory_proto::rr::RData::CNAME(cname)) => { - debug!( - "{} resolved to CNAME {}, asking recursively", - host, cname.0 - ); - return query( - rtype, - &cname.0.to_ascii(), - server, - socket, - ) - .await; - } - ( - hickory_proto::rr::RecordType::A, - hickory_proto::rr::RData::A(addr), - ) => { - return Some(std::net::IpAddr::V4(addr.0)); - } - ( - hickory_proto::rr::RecordType::AAAA, - hickory_proto::rr::RData::AAAA(addr), - ) => { - return Some(std::net::IpAddr::V6(addr.0)); - } - _ => return None, + match (rtype, ans.data()) { + (_, hickory_proto::rr::RData::CNAME(cname)) => { + debug!( + "{} resolved to CNAME {}, asking recursively", + host, cname.0 + ); + return query( + rtype, + &cname.0.to_ascii(), + server, + socket, + ) + .await; } - }; + ( + hickory_proto::rr::RecordType::A, + hickory_proto::rr::RData::A(addr), + ) => { + return Some(std::net::IpAddr::V4(addr.0)); + } + ( + hickory_proto::rr::RecordType::AAAA, + hickory_proto::rr::RData::AAAA(addr), + ) => { + return Some(std::net::IpAddr::V6(addr.0)); + } + _ => return None, + } } } None