Repository navigation
Support per-server custom CA certificates for HTTP MCP upstreams - #15067
Merged
Merged
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for per-server custom CA certificates for HTTP MCP upstreams
Support per-server custom CA certificates for HTTP MCP upstreams
Oct 16, 2026
lpcox
marked this pull request as ready for review
October 16, 2026 19:43
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
CA loading can silently omit certificates that passed validation when their PEM blocks contain headers.
1 open finding
What changed in this PR
Adds per-server custom CA configuration for HTTP MCP upstreams without changing global trust or disabling TLS verification.
Changes:
- Add JSON and TOML CA file settings with HTTP-only validation.
- Load custom certificates into connection-local trust pools.
- Add configuration and TLS tests plus documentation.
| File | Description |
|---|---|
| internal/mcp/connection.go | Load custom CAs for HTTP connections. |
| internal/mcp/connect_timeout_test.go | Test private trust, isolation, and invalid files. |
| internal/launcher/launcher.go | Pass CA configuration to HTTP connections. |
| internal/config/validation_server.go | Reject CA settings on non-HTTP servers. |
| internal/config/validation_schema_test.go | Cover the JSON CA field. |
| internal/config/schema/mcp-gateway-config.schema.json | Define caCertFile. |
| internal/config/config_stdin.go | Parse and propagate JSON CA configuration. |
| internal/config/config_stdin_test.go | Test CA field conversion. |
| internal/config/config_core.go | Add TOML CA configuration and validation. |
| internal/config/config_core_test.go | Test TOML CA field loading. |
| docs/CONFIGURATION.md | Document CA settings and TLS behavior. |
🧠 Review effort: Max
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Collaborator
|
@copilot address review feedback |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Contributor
Author
Fixed in commit |
This was referenced Oct 16, 2026
This was referenced Oct 17, 2026
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.

HTTP MCP upstreams using private CAs could not be trusted without changing runner-wide trust. Add per-server CA configuration that preserves system trust and standard TLS verification.
caCertFilein JSON stdin andca_cert_filein TOML for HTTP servers.{ "type": "http", "url": "https://mcp.internal.example", "caCertFile": "/etc/mcp/internal-ca.pem" }