diff --git a/Cargo.lock b/Cargo.lock index e1eed680..a330d22f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -426,6 +426,7 @@ dependencies = [ "either", "figment", "futures-util", + "hickory-resolver", "hmac", "http", "hyper", @@ -467,7 +468,6 @@ dependencies = [ "tracing-flame", "tracing-opentelemetry", "tracing-subscriber", - "trust-dns-resolver", "webpage", ] @@ -950,6 +950,51 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hickory-proto" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.4.0", + "ipnet", + "once_cell", + "rand", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot", + "rand", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "hmac" version = "0.12.1" @@ -2029,9 +2074,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.26" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bf93c4af7a8bb7d879d51cebe797356ff10ae8516ace542b5182d9dcac10b2" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", @@ -2039,6 +2084,7 @@ dependencies = [ "futures-core", "futures-util", "h2", + "hickory-resolver", "http", "http-body", "hyper", @@ -2062,7 +2108,6 @@ dependencies = [ "tokio-rustls", "tokio-socks", "tower-service", - "trust-dns-resolver", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -2300,8 +2345,8 @@ dependencies = [ [[package]] name = "rust-librocksdb-sys" -version = "0.18.1+8.11.3" -source = "git+https://github.com/zaidoon1/rust-rocksdb?rev=3e4a0f632a8c0c2839c7d183725c53895110d907#3e4a0f632a8c0c2839c7d183725c53895110d907" +version = "0.19.0+9.0.0" +source = "git+https://github.com/zaidoon1/rust-rocksdb?rev=4b8491b9db45066115435881184902bbb23d3811#4b8491b9db45066115435881184902bbb23d3811" dependencies = [ "bindgen", "bzip2-sys", @@ -2316,8 +2361,8 @@ dependencies = [ [[package]] name = "rust-rocksdb" -version = "0.22.7" -source = "git+https://github.com/zaidoon1/rust-rocksdb?rev=3e4a0f632a8c0c2839c7d183725c53895110d907#3e4a0f632a8c0c2839c7d183725c53895110d907" +version = "0.22.8" +source = "git+https://github.com/zaidoon1/rust-rocksdb?rev=4b8491b9db45066115435881184902bbb23d3811#4b8491b9db45066115435881184902bbb23d3811" dependencies = [ "libc", "rust-librocksdb-sys", @@ -3169,52 +3214,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "trust-dns-proto" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot", - "rand", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", - "trust-dns-proto", -] - [[package]] name = "try-lock" version = "0.2.5" diff --git a/Cargo.toml b/Cargo.toml index 35e0b018..c2987d73 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ base64 = "0.22.0" ring = "0.17.8" # Used when querying the SRV record of other servers -trust-dns-resolver = "0.23.2" +hickory-resolver = "0.24.0" # Used to find matching events for appservices regex = "1.10.3" @@ -101,7 +101,7 @@ features = [ ] [dependencies.reqwest] -version = "0.11.26" +version = "0.11.27" default-features = false features = [ "rustls-tls-native-roots", @@ -255,7 +255,7 @@ features = [ [dependencies.rust-rocksdb] git = "https://github.com/zaidoon1/rust-rocksdb" #branch = "master" -rev = "3e4a0f632a8c0c2839c7d183725c53895110d907" +rev = "4b8491b9db45066115435881184902bbb23d3811" optional = true default-features = true features = [ diff --git a/src/api/server_server.rs b/src/api/server_server.rs index a2395526..471d4e8c 100644 --- a/src/api/server_server.rs +++ b/src/api/server_server.rs @@ -13,6 +13,7 @@ use std::{ use axum::{response::IntoResponse, Json}; use futures_util::future::TryFutureExt; use get_profile_information::v1::ProfileField; +use hickory_resolver::{error::ResolveError, lookup::SrvLookup}; use http::header::{HeaderValue, AUTHORIZATION}; use ipaddress::IPAddress; use ruma::{ @@ -53,7 +54,6 @@ use ruma::{ use serde_json::value::{to_raw_value, RawValue as RawJsonValue}; use tokio::sync::RwLock; use tracing::{debug, error, info, warn}; -use trust_dns_resolver::{error::ResolveError, lookup::SrvLookup}; use crate::{ api::client_server::{self, claim_keys_helper, get_keys_helper}, diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index 360e3b64..6858631e 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -17,6 +17,7 @@ use argon2::Argon2; use base64::{engine::general_purpose, Engine as _}; pub use data::Data; use futures_util::FutureExt; +use hickory_resolver::TokioAsyncResolver; use hyper::{ client::connect::dns::{GaiResolver, Name}, service::Service as HyperService, @@ -34,7 +35,6 @@ use ruma::{ }; use tokio::sync::{broadcast, watch::Receiver, Mutex, RwLock, Semaphore}; use tracing::{error, info}; -use trust_dns_resolver::TokioAsyncResolver; use crate::{api::server_server::FedDest, services, Config, Error, Result}; @@ -497,7 +497,7 @@ fn reqwest_client_builder(config: &Config) -> Result { }); let mut reqwest_client_builder = reqwest::Client::builder() - .trust_dns(true) + .hickory_dns(true) .pool_max_idle_per_host(1) .pool_idle_timeout(Duration::from_secs(18)) .connect_timeout(Duration::from_secs(60)) @@ -526,7 +526,7 @@ fn url_preview_reqwest_client_builder(config: &Config) -> Result