mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[PR #2179] [MERGED] resolver: err for dns-over-rustls w/o roots #2861
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#2861
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?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/2179
Author: @cpu
Created: 4/13/2024
Status: ✅ Merged
Merged: 4/14/2024
Merged by: @djc
Base:
main← Head:cpu-err-no-rustls-roots📝 Commits (1)
cf30a1eresolver: err for dns-over-rustls w/o roots📊 Changes
2 files changed (+16 additions, -0 deletions)
View changed files
📝
crates/resolver/src/name_server/name_server_pool.rs(+6 -0)📝
crates/resolver/src/tls/dns_over_rustls.rs(+10 -0)📄 Description
If we're setting up dns-over-rustls and find that we've constructed a Rustls root cert store that has no trust anchors, return an early error. This makes the problem obvious and avoids surfacing some other less specific error cause when we first try to validate a peer certificate with an empty root store.
In order for our new early error to be surfaced correctly the
name_sever_pool.rsparallel_conn_loopfn needs its error handling adjusted. Previously it would always compare the new error produced by trying to build the TLS config against the default error it starts its loop with,ProtoErrorKind::NoConnections. Since the error being returned is anotherProtoErrorKindthat isn'tNoRecordsFound,Io, orTimeoutthe error specificity comparison considers the two errors equivalent in the general case, and the default error was always returned and the new error thrown away.There is still a small mystery around why a more specific error from tokio-rustls isn't returned when peer validation inevitably fails. In my testing upstream we get a niceSee my comment here I think this is a side-effect of theio::Errorlikeerr: Custom { kind: InvalidData, error: InvalidCertificate(UnknownIssuer) }. I can't figure out where or why, but something in the Hickory DNS stack is reducing this down to just a simple io error with typeInvalidData- no nested source error or message.Cloneimpl onProtoErrorKind.Updates https://github.com/hickory-dns/hickory-dns/issues/2066
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.