feat(backend): support custom SSL root CAs for internal GitLab instances#1058
feat(backend): support custom SSL root CAs for internal GitLab instances#1058jeremyeder wants to merge 2 commits intomainfrom
Conversation
Add a shared httputil package that loads additional CA certificates from the CUSTOM_CA_BUNDLE environment variable and applies them to a reusable http.Transport. Update all outbound HTTP clients that connect to user-configured hosts (GitLab, GitHub, Jira, Google OAuth) to use the shared transport. The transport mirrors net/http.DefaultTransport settings (proxy, HTTP/2, dial timeouts, keep-alive) and gracefully falls back to Go defaults if the bundle file is unreadable or contains no valid PEM certificates. Closes #1038 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
What do you think about the first option ( |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
I tried |
Summary
httputilpackage with a sharedhttp.Transportthat loads additional CA certificates from theCUSTOM_CA_BUNDLEenvironment variable, appending them to the system cert poolValidateGitLabToken,ValidateGitHubToken,ValidateJiraToken,ValidateGoogleToken,gitlab.NewClient) to use the shared transportnet/http.DefaultTransportsettings (proxy, HTTP/2, dial timeouts, keep-alive) and falls back gracefully to Go defaults on any CA loading failureCloses #1038
Test plan
CUSTOM_CA_BUNDLEto a valid PEM file with a corporate CA and verify connections to an internal GitLab instance succeedCUSTOM_CA_BUNDLEsetCUSTOM_CA_BUNDLEto a nonexistent path and verify the backend starts with a warning log and falls back to system CAsCUSTOM_CA_BUNDLEto a file with invalid PEM content and verify the backend starts with a warning and falls back to system CAsHTTP_PROXY/HTTPS_PROXYenvironment variables are still respected🤖 Generated with Claude Code