opentelemetry-collector
opentelemetry-collector copied to clipboard
Validate TLS config: return error if cert or key is missing
Description
If TLS is configured without a certificate or key, it currently fails at runtime with a TLS handshake error. current change fixes #13130 by adding a validation check in configtls.Config.Validate() to ensure that TLS configurations include both a certificate and a key.
missing certs caused confusing runtime handshake errors. With this change, users get clear validation error earlier.
Fixes #13130
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: gupta-nu / name: Ananya Gupta (66157a2f772089502eff8529c0b690b91ee43185, 155d4e5d0fde163ef6b751846263244fd84d50c4, ba4f4e6bb7fc539494cc81c1b865d1fb22405d36, dffec0faf7606a565e33771a8af065d8b717bbe5, d813bb33a1b2c2ef52570dd48fe873b59c9f307e, 4df2df8ccef82d47b33fc99e00d6be102142ea5a)
Could you add a test?
Added test TestConfig_Validate_CertKeyPresence in config_test.go to verify TLS cert/key combinations. Lmk if anymore adjustments are required!
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 91.30%. Comparing base (
c4c0814) to head (4df2df8). Report is 94 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #13134 +/- ##
==========================================
+ Coverage 91.28% 91.30% +0.01%
==========================================
Files 508 509 +1
Lines 28661 28747 +86
==========================================
+ Hits 26164 26248 +84
- Misses 1980 1986 +6
+ Partials 517 513 -4
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
This will need a changelog entry. And we should have another PR in contrib fixing the failing tests.
Thks!! I've added a changelog entry to this PR. I'll open the separate PR to address failing tests there
Hi! I've opened the contrib PR to fix the tests: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/40446 Please lmk if there are any changes required ,thnks!
open-telemetry/opentelemetry-collector-contrib/pull/40452 will fix the contrib tests. I am working on it
Please add changelog entry
Superseded by #13245. continued the work as this PR was inactive.
This PR was marked stale due to lack of activity. It will be closed in 14 days.
Closing, as this has been superseded by #13245