diff --git a/Cargo.lock b/Cargo.lock index ddda6692..b62ee967 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2058,6 +2058,29 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +[[package]] +name = "trust-dns-https" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2663f69cd36a5e99a93825d1f3aff834de2bb3cca2989316f3c9504a63a0c0a5" +dependencies = [ + "bytes 1.0.0", + "cfg-if 1.0.0", + "data-encoding", + "futures-util", + "h2", + "http", + "log", + "rustls", + "thiserror", + "tokio 1.0.1", + "tokio-rustls", + "trust-dns-proto", + "trust-dns-rustls", + "webpki", + "webpki-roots", +] + [[package]] name = "trust-dns-proto" version = "0.20.0" @@ -2103,6 +2126,7 @@ dependencies = [ "thiserror", "tokio 1.0.1", "tokio-rustls", + "trust-dns-https", "trust-dns-proto", "trust-dns-rustls", "webpki-roots", diff --git a/crates/shadowsocks-service/Cargo.toml b/crates/shadowsocks-service/Cargo.toml index 0a98faf1..8dfb6945 100644 --- a/crates/shadowsocks-service/Cargo.toml +++ b/crates/shadowsocks-service/Cargo.toml @@ -37,7 +37,7 @@ manager = ["server"] # Enables trust-dns for replacing tokio's builtin DNS resolver trust-dns = ["trust-dns-resolver", "shadowsocks/trust-dns"] dns-over-tls = ["trust-dns", "trust-dns-resolver/dns-over-tls", "trust-dns-resolver/dns-over-rustls"] -dns-over-https = ["trust-dns", "trust-dns-resolver/dns-over-https"] +dns-over-https = ["trust-dns", "trust-dns-resolver/dns-over-https", "trust-dns-resolver/dns-over-https-rustls"] # Enable DNS-relay local-dns = ["local", "trust-dns", "rand"] diff --git a/crates/shadowsocks-service/src/config.rs b/crates/shadowsocks-service/src/config.rs index 81631b89..af68a4f3 100644 --- a/crates/shadowsocks-service/src/config.rs +++ b/crates/shadowsocks-service/src/config.rs @@ -1009,7 +1009,7 @@ impl Config { protocol: Protocol::Udp, tls_dns_name: None, trust_nx_responses: false, - #[cfg(feature = "dns-over-tls")] + #[cfg(any(feature = "dns-over-tls", feature = "dns-over-https"))] tls_config: None, }); c.add_name_server(NameServerConfig { @@ -1017,7 +1017,7 @@ impl Config { protocol: Protocol::Tcp, tls_dns_name: None, trust_nx_responses: false, - #[cfg(feature = "dns-over-tls")] + #[cfg(any(feature = "dns-over-tls", feature = "dns-over-https"))] tls_config: None, }); }