Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass quinn::Endpoint for DoQ and DoH3 #2002

Open
daxpedda opened this issue Aug 21, 2023 · 3 comments · May be fixed by #2003
Open

Pass quinn::Endpoint for DoQ and DoH3 #2002

daxpedda opened this issue Aug 21, 2023 · 3 comments · May be fixed by #2003

Comments

@daxpedda
Copy link
Contributor

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::Endpoint across multiple libraries in use.

Describe the solution you'd like
Add a method to trust_dns_proto::quic::QuicClientStreamBuilder and trust_dns_resolver::config::NameServerConfigGroup to supply a quinn::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
Copy link
Collaborator

djc commented Aug 21, 2023

Makes sense to me.

@daxpedda
Copy link
Contributor Author

Was just working on an implementation but hit a roadblock:
https://github.com/bluejekyll/trust-dns/blob/fba0c67f8fd65956bc4eb8ca95c04ccd5314088e/crates/proto/src/quic/quic_client_stream.rs#L244
https://github.com/bluejekyll/trust-dns/blob/fba0c67f8fd65956bc4eb8ca95c04ccd5314088e/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 from Endpoint, but that didn't seem to actually help, because quinn::Endpoint stores these as dyn quinn::crypto::ClientConfig, which doesn't require Any so I can't upcast it.

So an easy solution that comes to mind is to extend quinn::crypto::ClientConfig with 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 if rustls::client::ClientConfig::enable_early_data isn't enabled in the first place?

Any guidance would be appreciated.

@daxpedda daxpedda linked a pull request Aug 21, 2023 that will close this issue
2 tasks
@djc
Copy link
Collaborator

djc commented Aug 22, 2023

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 if rustls::client::ClientConfig::enable_early_data isn't enabled in the first place?

That sounds right, and I think I figured out how it works:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants