mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #2249] TokioAsyncResolver fails with ResolveError { kind: Proto(ProtoError { kind: Io(Kind(ConnectionRefused)) }) } #935
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#935
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zsdsys on GitHub (Jun 19, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2249
Describe the bug
TokioAsyncResolver configured with tls defaults fails with error ConnectionRefused
To Reproduce
Expected behavior
expected to resolve names via dns-over-rustls
System:
Version:
Crate: hickory-resolver
Version: { version = "0.24.1", features = ["dns-over-rustls"] }
Additional context
using the same code above with ResolverConfig::cloudflare() works as expected (but not secure of course).
I was also able to debug and it is indeed failing:
2024-06-19 14:06:04.239162 DEBUG hickory_proto::xfer::dns_exchange stream errored while connecting error=io error: tls error: invalid peer certificate: UnknownIssuer
I also attempted to set_tls_client_config with
but that fails as a rustls::ClientConfig is not a rustls::client::client_conn::ClientConfig and that is now private/inaccessible with newer rustls
@cpu commented on GitHub (Jun 19, 2024):
I suspect you're hitting this issue described in https://github.com/hickory-dns/hickory-dns/issues/2066 and clarified by https://github.com/hickory-dns/hickory-dns/pull/2179 and https://github.com/hickory-dns/hickory-dns/pull/2181 (in the pre-release version only). Try adding the
webpki-rootsfeature in addition todns-over-rustls.This smells like trying to use a different major version of Rustls than what Hickory-DNS 0.24.1 is using. The error message is confusing, but you shouldn't need to access any private/inaccessible types to resolve this.
@zsdsys commented on GitHub (Jun 19, 2024):
fascinating issue, adding the feature webpki-roots works (I already had that create for other purposes so did not realize that feature)
I am using rustls rustls = { version = "0.23", default-features = false, features = ["ring","std",] }
the issue of rustls::client::client_conn being changed to private has been a real PITA as a lot of code samples I come across
@cpu commented on GitHub (Jun 19, 2024):
The requirement should be clearer once the fix from https://github.com/hickory-dns/hickory-dns/pull/2179 makes it into a finalized release 🤞
That would indeed be the problem. hickory-dns 0.24.1 uses rustls 0.21:
github.com/hickory-dns/hickory-dns@e56a18ee24/Cargo.toml (L64)You would need to do the same for theClientConfigto be compatible.Edit: You can follow https://github.com/hickory-dns/hickory-dns/pull/2217 for the 0.23 update progress.