Repository navigation
fix(mcp): require HTTPS for remote connections - #1910
Draft
Qiyuanqiii wants to merge 1 commit into
Draft
Qiyuanqiii wants to merge 1 commit into
Qiyuanqiii wants to merge 1 commit into
Conversation
Co-authored-by: Irvallen Saragih <[email protected]>
Contributor
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s). |
This was referenced Nov 12, 2026
Contributor
Author
|
This PR is split out from #1738, so we'll wait it for the time being. |
This branch has not been deployed
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.
Behavior
Remote MCP connections now require HTTPS before headers are expanded or sent. HTTP remains available for explicit localhost or loopback IP endpoints used in local development. Redirects must retain the original scheme, host and effective port, preventing configured headers from being reapplied to another origin.
Extracted from #1738 into an independent PR against
main. This works with existing manually configured MCP servers; it contains no plugin package manager, project locks or VCS changes. Non-loopback HTTP configurations must migrate to HTTPS.Review order
internal/mcp/endpoint.go: endpoint and redirect policy.internal/mcp/client.go: apply the policy before connecting.internal/mcp/endpoint_test.go: URL cases and actual MCP connections, redirects and credential delivery.Validation
Verified on Windows with Go 1.26.10:
make license-addandmake checkpassed.make test PACKAGES=./internal/mcppassed with the race detector.Credit and AI disclosure
@irvallensar is retained as co-author for the HTTPS-by-default proposal. The trusted-policy integration-test contribution stays with the deferred CI work from #1738.
OpenAI Codex (GPT-6) assisted with extraction, tests and documentation; OCR reviewed the change using the configured DeepSeek provider. Earlier implementation also used GPT-6.1 Sol agents.