fix: http connection transport TLS#1978
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR refactors HTTP TLS handling by introducing ChangesHTTP TLS Handling
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Benchstat (Other)Base: ✅ 1 improvement(s)
Full benchstat output |
Benchstat (RLS)Base: 📊 6 minor regression(s) (all within 5% threshold)
✅ 4 improvement(s)
Full benchstat output |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@connection/http.go`:
- Around line 42-43: TLSConfig.IsEmpty currently treats a config with only Cert
or only Key as non-empty but the certificate-loading code (around the client
cert load at lines ~64-70) only creates a tls.Certificate when both PEMs are
present, allowing a partial mTLS config to silently fall back; update
TLSConfig.IsEmpty to treat a config as invalid/non-empty when exactly one of
Cert or Key is present (i.e. detect XOR) and change the certificate-loading
logic (the client cert construction path) to return an explicit error when Cert
is provided without Key or Key without Cert instead of skipping client cert
creation so partial client-certificate input is rejected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9a02ce7a-013c-477a-84ae-10192f423b24
📒 Files selected for processing (2)
connection/http.goconnection/http_test.go
HTTPConnection TLS setup previously treated a lone client certificate or key as configured but skipped client certificate loading unless both PEM values were present. Detect partial client certificate configuration and return an explicit error, and cover successful mTLS use through the HTTPConnection transport.
Gavel resultsGavel exited with code . |
Summary by CodeRabbit
Improvements
Tests