mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #1990] DoQ default configuration is invalid #841
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#841
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 @daxpedda on GitHub (Jul 21, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1990
Currently DoT, DoH and DoQ share the same
ClientConfig:github.com/bluejekyll/trust-dns@bf04bc8d3e/crates/resolver/src/tls/dns_over_rustls.rs (L30-L56)All three implementations can't share the same configuration as they differ on some properties:
We probably want to continue disable SNI for DoT by default (though the only public server that I found supporting DoQ, AdGuard, requires SNI for both DoQ and DoT), but disabling SNI for DoH by default is strange.
The fast fix is probably easy, just use a different
ClientConfigfor each protocol. This does have a big downside though, when using multiple backends this will parse the root certificates multiple times.This in turn could be solved by using
WebPkiVerifier, but that would requiredangerous_configurationand I'm not sure if we want to use that because it would activate it for upstream users as well.So unless we are fine with activating
dangerous_configuration, this would probably require some fix in Rustls. Considering @djc maintains both, I'm gonna hold back from creating an issue there until further feedback.@djc commented on GitHub (Jul 21, 2023):
I think the rustls QUIC code does the right thing for protocol versions, and will restrict to 1.3 when starting a QUIC connection. Do you have actual evidence to the contrary? Otherwise, I don't think that's an issue.
As long as we don't run the rustls-native-certs loading process multiple times, I think other parts of the config creation aren't likely to have much of a performance impact presuming that we create one TLS config per resolver config (or equivalent).
@daxpedda commented on GitHub (Jul 21, 2023):
No! I only tested ALPN and SNI.
I didn't know that, but it makes sense.
EDIT: Removed it from OP.
@djc commented on GitHub (Aug 23, 2023):
I think rustls would definitely accept a change to take an
Arc<RootCertStore>instead ofRootCertStoredirectly. See also https://github.com/rustls/rustls/issues/1403. Perhaps there's a way of doing this that is semver-compatible? I was thinkingwith_root_certificates()could take some kind ofimpl AsRef<RootCertStore> + 'staticbut wrangling that in there semver-compatibly might not be feasible.@djc commented on GitHub (Aug 23, 2023):
See also https://github.com/rustls/rustls/pull/1413 (which will go into rustls 0.22).
@bluejekyll commented on GitHub (Sep 6, 2023):
@daxpedda, with #2005 merged, what are the potential other changes needed here? Or is that enough?
@daxpedda commented on GitHub (Sep 6, 2023):
#2005 did not fix this issue.
The current plan is to store the root certificates in an
Arc<RootCertStore>and then store the defaultRustConfigin the runtime. There we need to split it up into a separateRustConfigfor each backend: DoT, DoH, DoQ.I'm planning to put up a PR in the next couple of days!
@bluejekyll commented on GitHub (Sep 7, 2023):
Awesome! Thank you!