mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[PR #3276] [MERGED] Implement RFC 9539 opportunistic encryption for recursive resolver #3701
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#3701
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/3276
Author: @cpu
Created: 9/22/2025
Status: ✅ Merged
Merged: 10/16/2025
Merged by: @cpu
Base:
main← Head:cpu-9539_dev📝 Commits (6)
6ae7350resolver: allow skipping TLS peer verification0d79600start modelling opportunistic encryption config2bd9a74start tracking opportunistic enc. transport stateb8f2289resolver: offer access to ConnectionProvider::RuntimeProvider5039a9aimplement opportunistic encryption probing5f831c5conformance: add hickory resolver rfc 9539 tests📊 Changes
17 files changed (+2086 additions, -58 deletions)
View changed files
📝
bin/src/lib.rs(+9 -0)📝
bin/tests/integration/config_tests.rs(+8 -0)📝
conformance/dns-test/src/tshark.rs(+34 -9)📝
conformance/e2e-tests/src/recursor.rs(+1 -0)➕
conformance/e2e-tests/src/recursor/rfc9539.rs(+1 -0)➕
conformance/e2e-tests/src/recursor/rfc9539/scenarios.rs(+267 -0)📝
crates/recursor/src/recursor.rs(+27 -1)📝
crates/recursor/src/recursor_dns_handle.rs(+47 -8)📝
crates/resolver/src/config.rs(+344 -2)📝
crates/resolver/src/name_server/connection_provider.rs(+98 -2)📝
crates/resolver/src/name_server/name_server.rs(+1020 -23)📝
crates/resolver/src/name_server/name_server_pool.rs(+38 -6)📝
crates/resolver/src/resolver.rs(+41 -2)📝
crates/server/src/store/recursor.rs(+34 -1)📝
tests/integration-tests/src/mock_client.rs(+4 -0)📝
tests/integration-tests/tests/integration/name_server_pool_tests.rs(+16 -4)➕
tests/test-data/test_configs/example_recursor_opportunistic_enc.toml(+97 -0)📄 Description
If we prefer opportunistic encryption and are evaluating pre-existing name server connections, prefer encrypted ones first. If we only have unencrypted pre-existing connections, but we've registered a recent successful probe on an encrypted protocol, don't reuse the conn at all. Instead make a new conn using the successfully probed encrypted protocol.
When sorting connection configs to make a new connection, and using opportunistic encryption, consider whether we've had a successful response read from an encrypted connection to the name server within the persistence period. If so, prefer those configs to make new encrypted connections with the same protocol.
Lastly, when opportunistic encryption is enabled, and we select a non-encrypted connection config (e.g. because we don't have a pre-existing encrypted conn, or because we don't have a successful response recorded on an encrypted transport within the persistence period) and we haven't recorded a failure within the damping period, then try to probe the name server on an encrypted protocol. Use the result to update the name server encrypted transport state so that the next time we'll know whether to jump straight to an encrypted transport, or if we should continue to use the unencrypted transport. Constrain the number of extant probes based on a configurable budget.
Follow-up items out of scope for this first PR:
hickory-dns. It would be nice to sort out so that a reboot doesn't cause the resolver to have to re-discover the world with fresh probes.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.