mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #2431] How to get rid of openssl from the dependency tree? #986
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#986
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 @AaronKutch on GitHub (Sep 5, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2431
Unless I'm misunderstanding something, I can/should be able to remove
opensslfrom the dependency tree (which would make it significantly easier to build the hickory-dns server and expunge the remaining non-Rust dependencies for my use case). Are there any issues that could arise?One of the first things standing out from the
Cargo.tomlfeatures is that all the activations of optional dependencies like(which appears to be intended to activate the feature flag and not pull in
hickory-resolverby itself)Should be written like
(which only activates the feature flag if
hickory-resolverwas actually pulled in)(I forgot what this question mark case was called, it is difficult to search for), because building for a specific binary with
--no-default-features --features=dns-over-rustlswill build all of them together if even one of these is triggered without the?. This issue is also causingopensslto be introduced from somewhere even when I don't have-opensslfeatures, and I notice when trying to edit the Cargo.tomls that there is an error with a singleResolveErrorbeing pulled in fromhickory-resolverthat should probably be inhickory-proto.I am also unsure about what features I actually need to enable for a public DNS server that should handle all of whatever a "standard" DNS server should. Why does the
hickory-dnsserver crate pull in the recursor and resolver, shouldn't those only be for clients?@djc commented on GitHub (Sep 6, 2024):
Can you be more specific about what crate's
Cargo.tomlyou're looking at? Is it the top-level server binary?I think "weak" was used at some point to describe the
?here -- in any case, the feature resolution stuff is documented at https://doc.rust-lang.org/cargo/reference/features.html#dependency-features if that helps.One problem is that there isn't a very good definition of what a "standard" DNS server is. Do you mean an authoritative server (that is delegated to by the parent zone's DNS server to resolve records for the zone) or a "stub" resolver (which we call a recursor)? The hickory-server crate also supports a wide range of protocols which is probably more extensive than that of many other implementations.
You didn't mention what version you're working with -- if 0.24.x, I suggest you try 0.25.0-alpha.2 (which should have decent quality) which improved a bunch on the dependency handling front.
@AaronKutch commented on GitHub (Sep 6, 2024):
All the higher level
Cargo.tomls have this problem on the currentmainbranch and on0.25.0-alpha.2which I am currently using. Even though they are not being used in the code, dependencies and whole extra binaries are being built when they shouldn't, and causing build issues or just adding unnecessary time.cargo build --bin hickory-dnswith affected flags will build several binaries and not just the server which adds unnecessary time, and it also brings inopensslwhen it shouldn't.I should specify by "standard" that I mean just a DNS server like
1.1.1.1or8.8.8.8. It will add some authoritative entries for a VPN overlay network but otherwise needs to cache normal things and act as a public DNS that would work with almost every program. I don't know if I should add on every protocol I can or if there are only some basic ones I should include. Is there anything important I leave out if I exclude all the openssl variants? What does it mean to activatedns-over-opensslanddns-over-rustlsat the same time? What are the threednssecvariants each doing?@marcus0x62 commented on GitHub (Sep 7, 2024):
Hi @AaronKutch, a few things:
For me, at least, the following works for building a bare-bones server that supports hosting an authoritative zone and is capable of sending forwarding queries to an upstream server:
Disabling the various TLS options (and DNSSEC) will eliminate support for DNS over HTTPS and DNSSEC, and probably some other things I'm not thinking of, but not regular old unauthenticated DNS-over-UDP/TCP. Note that you can't build support for DNSSEC without also including the dns-over-rustls feature flag.
We're recommending people not expose their hickory servers directly to the Internet at this point - there's still some hardening work to do on the server side, particularly with TCP connections.
@djc commented on GitHub (Sep 9, 2024):
If I run
cargo tree --features dns-over-rustlsin the/bindirectory and review the resulting dependency tree, I do not see the openssl dependency appear. Can you clarify exactly what dependencies you are enabling?I tried to clean up the server's feature forwarding a bit in https://github.com/hickory-dns/hickory-dns/pull/2441, please review.
@AaronKutch commented on GitHub (Sep 9, 2024):
@marcus0x62 Thanks, I only needed to add "sqlite" to that for updating capability.
I could've sworn it was bringing in
opensslwith any feature last time I tried, it seems to be working perfectly today for whatever reason. It works now and works even better with the PR.