fix(trillianclient): strip dns:/// scheme from TLS ServerName in gRPC dial#2812
Conversation
|
could you add a test case here to ensure this doesn't break going forward? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2812 +/- ##
===========================================
- Coverage 66.46% 26.33% -40.13%
===========================================
Files 92 191 +99
Lines 9258 20261 +11003
===========================================
- Hits 6153 5336 -817
- Misses 2359 14088 +11729
- Partials 746 837 +91
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sorry, i should have been clearer. in |
|
can you rebase this please and i'll merge |
… dial Signed-off-by: kdacosta0 <[email protected]>
Signed-off-by: kdacosta0 <[email protected]>
Signed-off-by: kdacosta0 <[email protected]>
|
@bobcallaway Rebased and pushed, lmk if you need anything else |
Summary
When the Trillian gRPC address includes a
dns:///resolver scheme (used to enable client-sideround_robinload balancing with headless Kubernetes Services), thedial()function passes the raw address, scheme included, intotls.Config.ServerNameand the gRPC channel authorityThis breaks TLS: the x509 certificate verification matches SANs against
"dns"(the URI scheme) instead of the actual hostname, failing with:The fix strips the
dns:///prefix into acleanHostnamefor TLSServerNameandgrpc.WithAuthority(), while preserving the full scheme in thegrpc.NewClienttarget so the DNS resolver stays activestrings.TrimPrefixis a no-op when the prefix is absent, so callers passing plain hostnames are unaffectedTested on an OpenShift cluster with internal TLS:
Release Note
Fixed a bug where using the
dns:///gRPC resolver scheme in the Trillian server address caused TLS certificate verification to fail. The URI scheme was incorrectly used as the TLS ServerName instead of the actual hostname. This affected deployments using client-side gRPC load balancing (round_robin) with TLS enabled.Documentation