fix: don't request client cert SDS when only CAFile is set#23679
fix: don't request client cert SDS when only CAFile is set#23679mrgupta7 wants to merge 4 commits into
Conversation
Go Test Coverage: 61.7%See the workflow run for the full per-package breakdown and downloadable HTML report. |
Codecov ReportCaution This repository is currently using the Sentry GitHub App to receive Codecov PR comments. This integration will be deprecated on July 8, 2026. Please install the Codecov GitHub App to continue receiving coverage reports on your pull requests. Additional details and impacted files@@ Coverage Diff @@
## main #23679 +/- ##
==========================================
- Coverage 59.67% 59.36% -0.32%
==========================================
Files 945 752 -193
Lines 114721 91520 -23201
==========================================
- Hits 68465 54332 -14133
+ Misses 39902 31867 -8035
+ Partials 6354 5321 -1033 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| TlsCertificateSdsSecretConfigs: []*envoy_tls_v3.SdsSecretConfig{ | ||
| { | ||
| Name: mapping.Service.Name + "-cert", | ||
| ctx := &envoy_tls_v3.CommonTlsContext{ |
There was a problem hiding this comment.
what is the difference in behaviour because of the code changes now ?
https://github.com/hashicorp/consul-enterprise/blob/main/agent/xds/secrets.go#L71
already we have published secrets via SDS .
here the reference is only provided as name.
There was a problem hiding this comment.
updated the envoy config changes before and after fix in description
7c2168c to
012656e
Compare
Description
When a Terminating Gateway service is configured with only CAFile (one-way TLS), makeUpstreamTLSContext was unconditionally emitting a TlsCertificateSdsSecretConfigs entry for svc-cert. Since no client cert is configured, the SDS server never pushes that secret, leaving Envoy's upstream cluster stuck in a permanent warming state and dropping all traffic to that service.
Updated the existing tests to handle such scenarios.
Testing & Reproduction steps
Tested with the setup - 200 OK response.
Links
Test Results
Envoy dynamic_active_cluster before fix
Envoy dynamic_active_cluster after fix
PR Checklist
PCI review checklist
I have documented a clear reason for, and description of, the change I am making.
If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
If applicable, I've documented the impact of any changes to security controls.
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.