[creds]: Accept ECDSA server certs in preferredCipherSuites#92
Open
parinmaru2 wants to merge 1 commit into
Open
[creds]: Accept ECDSA server certs in preferredCipherSuites#92parinmaru2 wants to merge 1 commit into
parinmaru2 wants to merge 1 commit into
Conversation
|
|
parinmaru2
force-pushed
the
pmaru/accept-ecdsa-server-certs
branch
2 times, most recently
from
July 25, 2026 06:46
0a702cb to
ec85d0c
Compare
parinmaru2
force-pushed
the
pmaru/accept-ecdsa-server-certs
branch
from
July 25, 2026 06:50
ec85d0c to
9264c19
Compare
Add TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 and _128_GCM_SHA256 to the preferred TLS 1.2 cipher suite list. Until now only ECDHE_RSA suites were allowed, so Validate() rejected any server credential whose leaf uses an ECDSA key with `key type "ecdsa" incompatible with allowed cipher suites`. Thats a real deployment blocker for identity systems that issue ECDSA leaves by default. Both suites still require ECDHE for forward secrecy and AES-GCM for authenticated encryption, so this only widens the set of acceptable leaf key types - not the negotiation surface. Update the ECDSA subtest and drop a now-inaccurate "RSA-only" comment on the RSA case.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #92 +/- ##
==========================================
+ Coverage 85.60% 87.95% +2.34%
==========================================
Files 33 63 +30
Lines 1042 2723 +1681
==========================================
+ Hits 892 2395 +1503
- Misses 128 250 +122
- Partials 22 78 +56 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pseudomuto
approved these changes
Jul 25, 2026
pseudomuto
left a comment
Collaborator
There was a problem hiding this comment.
Hey @parinmaru2, thanks for the PR!
Adding ECDSA is a straight win IMO, and this LGTM 👍 Once you sign the CLA, I'll get this merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384andTLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256topreferredCipherSuitesininternal/transport/creds/tls.go.Until now
preferredCipherSuiteslisted onlyECDHE_RSAvariants, soTLS.Validate()— viaUsesSecureCertificateAlgorithm(preferredCipherSuites...)ininternal/transport/creds/validation.go— rejected any server credential whose leaf uses an ECDSA key with:That's a real deployment blocker for identity systems that issue ECDSA leaves by default. Adding the two ECDHE_ECDSA_AES_GCM suites is the minimum change to accept ECDSA leaves without loosening any other property of the negotiated session:
So this widens the set of acceptable leaf key types on the server side without widening the negotiation surface.
Test plan
go test ./internal/transport/creds/...— passes locally.TestTLS_Validatesubtest for ECDSA:renamed
"ECDSA cert rejected by RSA-only cipher suites"→"ECDSA cert accepted", replaced therequire.ErrorContains(err, "key type")assertion withrequire.NoError(...).// preferredCipherSuites are RSA-onlycomment on the RSA-cert subtest.go vet ./internal/transport/creds/...clean.Notes for reviewers
HasSufficientKeySizeininternal/transport/creds/validation.goalready accepted ECDSA keys (min 256-bit curve) — that path was reachable but only via a non-emptyallowedSuitesset that included at least one ECDSA suite, which is why it hadn't been triggered by prior tests.MTLS.Validate()also feedspreferredCipherSuitesintoUsesSecureCertificateAlgorithm(seeinternal/transport/creds/mtls.go), so mTLS server-side validation gets the same fix for free.