mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #1642] Support for EC keys #720
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#720
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 @LuckyTurtleDev on GitHub (Feb 19, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1642
Is your feature request related to a problem? Please describe.
The caddy webserver, save let's encrypt certificates as EC keys. Because of the missing support for this keys in trust-dns, I can sadly not use the certificate for dot.
Describe the solution you'd like
The current rustls version dose support this certificates. see https://github.com/rustls/rustls/pull/998
So updating the rustls dependency should be enough to solve this issue.
@bluejekyll commented on GitHub (Feb 19, 2022):
Which version of rustls is needed? Can you check if the 0.21.0-alpha has that? If so, we’re probably going to release that branch next week.
@djc commented on GitHub (Feb 19, 2022):
Current rustls 0.20 supports it, so I think our alphas should be good.
@LuckyTurtleDev commented on GitHub (Feb 19, 2022):
rust tls does support EC since 0.20.3:
github.com/rustls/rustls@5bda754ac1/rustls/src/sign.rs (L288)0.21.0-alpha use rustls 0.20.0, witch does not support EC yet.
If you remove the
Cargo.lockrustls 0.20.4 is used. So the lockfile must be updated.@djc commented on GitHub (Feb 19, 2022):
Actually rustls did support such keys, just not the particular encoding used. So you could still make it work by reencoding the key in (I believe) PKCS #8.
@LuckyTurtleDev commented on GitHub (Feb 19, 2022):
The problem is that I must happen automatically, because the keys does change, if I get a new key from let's encrypt. Which does often happen.
@djc commented on GitHub (Feb 21, 2022):
I'm pretty sure Let's Encrypt generally does not generate keys for you (though I guess some of the client libraries might?), so key generation should be fully under your control. Are you using a Rust client library?
@bluejekyll commented on GitHub (Mar 1, 2022):
@Lukas1818, can you see if
0.21.1meets your needs? Recently released.@bluejekyll commented on GitHub (Mar 6, 2022):
ping @Lukas1818, did this resolve the issue for you?
@LuckyTurtleDev commented on GitHub (Mar 6, 2022):
hi, sorry I have not much time at the moment, I will checkout this at the next week.
@LuckyTurtleDev commented on GitHub (May 13, 2022):
hi, I was finally able to test this.
I have use the following config file:
But I get this error:
I have also try to use the
.crtfile instead.But I have get the same error.
I have use the the
dns-over-opensslfeature.If I use
dns-over-tlsinstead I get the following error instead:@LuckyTurtleDev commented on GitHub (May 13, 2022):
I am a bit confused, why I can not use Rustls for PKCS12, because I had though that Rustls does support it now:
https://github.com/rustls/rustls/pull/998
@bluejekyll commented on GitHub (May 14, 2022):
If rustls supports pkcs12, this is probably just a gap in support in trust-dns. We just need to add it to the logic for reading keys.
@bluejekyll commented on GitHub (May 15, 2022):
This is where we read the key:
github.com/bluejekyll/trust-dns@df82c60b34/crates/server/src/config/dnssec.rs (L397-L401)So if you specify pkcs12, we will bail directly. It looks like based on the code in the linked issue you showed, that maybe there's a simpler way to construct these keys directly from the der formats? (pem might be a different story)
@LuckyTurtleDev commented on GitHub (Dec 5, 2022):
I test this again with version 0.22.0 and I notify that my certificate is a SEC1 key.
So I think the problem is that trust-dns mistakes it for a Pkcs12 key and abort.
@LuckyTurtleDev commented on GitHub (Oct 29, 2023):
Based on my experience with crab-hole EC keys works fine with the hickory libs and it is an artificial limitation of the hickory binary.
@djc commented on GitHub (Oct 30, 2023):
A
BEGIN EC PRIVATE KEYis still PEM (and supported by rustls and rustls-pemfile) and is completely unrelated to PKCS12. I think the problem is thatTlsCertConfig::private_key_typeonly understandsPkcs8andDERwhich is more limiting than what rustls supports (in particular, AIUI the "EC keys" are PKCS8 keys but wrapped in additional SEC1 encoding).