Skip to content

Commit 26f2da0

Browse files
NobodyXudrahnr
authored andcommitted
Use rustls for tls & trust-dns-resolver for dns resolution
By default, reqwest uses native-tls, which is openssl on linux and that makes cross-compilation very hard as they need to compile openssl themselves and exposes it via pkg-config. Enabling vendored-openssl does not help there because the dep:openssl is only enabled by dist-server. reqwest by default uses libc's getaddrinfo, which is a poor solution that requires a dedicated thread and it is not nearly as reliable as trust-dns-resolver, not to mention libc implementation, e.g. musl, might deliberately leave out some features. Signed-off-by: Jiahao XU <[email protected]>
1 parent 6bbef54 commit 26f2da0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ number_prefix = "0.4"
5656
openssl = { version = "0.10.48", optional = true }
5757
rand = "0.8.4"
5858
regex = "1.7.3"
59-
reqwest = { version = "0.11", features = ["json", "blocking", "stream"], optional = true }
59+
reqwest = { version = "0.11", features = ["json", "blocking", "stream", "rustls-tls", "trust-dns"], optional = true }
6060
retry = "2"
6161
semver = "1.0"
6262
sha2 = { version = "0.10.6", optional = true }
@@ -65,6 +65,8 @@ serde_json = "1.0"
6565
strip-ansi-escapes = "0.1"
6666
tar = "0.4.36"
6767
tempfile = "3"
68+
# trust-dns-resolver must be kept in sync with the version reqwest uses
69+
trust-dns-resolver = { version = "0.22.0", features = ["dnssec-ring", "dns-over-rustls", "dns-over-https-rustls", "dns-over-quic"] }
6870
mime = "0.3"
6971
tokio = { version = "1", features = ["rt-multi-thread", "io-util", "time", "net", "process", "macros"] }
7072
tokio-serde = "0.8"

0 commit comments

Comments
 (0)