feat(backend): support custom SSL root CAs for internal GitLab instances#1058
Draft
jeremyeder wants to merge 2 commits intomainfrom
Draft
feat(backend): support custom SSL root CAs for internal GitLab instances#1058jeremyeder wants to merge 2 commits intomainfrom
jeremyeder 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>
Contributor
|
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 |
Contributor
|
What do you think about the first option ( |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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