mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #2002] Pass quinn::Endpoint for DoQ and DoH3 #845
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#845
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 (Aug 21, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2002
Is your feature request related to a problem? Please describe.
In an effort to reduce the resources used in my application, I would like to reuse the socket and other resources held by
quinn::Endpointacross multiple libraries in use.Describe the solution you'd like
Add a method to
trust_dns_proto::quic::QuicClientStreamBuilderandtrust_dns_resolver::config::NameServerConfigGroupto supply aquinn::Endpoint.Describe alternatives you've considered
There isn't a real alternative I can think of.
Additional context
Happy to write up the PR!
@djc commented on GitHub (Aug 21, 2023):
Makes sense to me.
@daxpedda commented on GitHub (Aug 21, 2023):
Was just working on an implementation but hit a roadblock:
github.com/bluejekyll/trust-dns@fba0c67f8f/crates/proto/src/quic/quic_client_stream.rs (L244)github.com/bluejekyll/trust-dns@fba0c67f8f/crates/proto/src/quic/quic_client_stream.rs (L254-L261)There is currently no way to get that information out of an
Endpoint. I was about to make a PR to Quinn to expose the default client configuration fromEndpoint, but that didn't seem to actually help, becausequinn::Endpointstores these asdyn quinn::crypto::ClientConfig, which doesn't requireAnyso I can't upcast it.So an easy solution that comes to mind is to extend
quinn::crypto::ClientConfigwith a method that returns if early data is enabled or not.That said, I have the suspicion that this check isn't needed in the first place because I think that
quinn::Connecting::into_0rtt()doesn't succeed ifrustls::client::ClientConfig::enable_early_dataisn't enabled in the first place?Any guidance would be appreciated.
@djc commented on GitHub (Aug 22, 2023):
That sounds right, and I think I figured out how it works:
quinn::Connecting::into_0rtt()] callsquinn_proto::Connection::has_0rtt(), which yields the value fromConnection::zero_rtt_enabled.quinn_proto::Connection::init_0rtt(), which calls intocrypto::Session::early_crypto()to decide if early data is enabled.<quinn::crypto::rustls::TlsSession as quinn::crypto::Session>::early_crypto()implementation callsrustls::quic::ConnectionCommon<Data>::zero_rtt_keys().common_state.quic.early_secret, which is set inrustls::KeyScheduleEarly::client_early_traffic_secret(). However, that mentions the 0-RTT secret will be clobbered byExtensionProcessingif 0-RTT should be rejected (but this only applies on the server).client_early_traffic_secret()gets called fromrustls::client::tls13::derive_early_traffic_secret.rustls::client::hs::emit_client_hello_for_retry(), after an early return for!cx.data.early_data.is_enabled().