fix: mount host CA certificate bundle into GitHub MCP server container#1169
Open
qozle wants to merge 1 commit intoanthropics:mainfrom
Open
fix: mount host CA certificate bundle into GitHub MCP server container#1169qozle wants to merge 1 commit intoanthropics:mainfrom
qozle wants to merge 1 commit intoanthropics:mainfrom
Conversation
On GHES with internal/corporate CAs, the Docker-based GitHub MCP server fails every API call with `x509: certificate signed by unknown authority` because the container has no access to the host's CA certificates. The self-hosted runner already trusts the GHES server (it communicates with it for job dispatch), so the CA bundle exists on the host. This change mounts it into the container at `/custom-ca/ca-bundle.crt` and sets `SSL_CERT_FILE` so the Go binary uses it for TLS verification. CA bundle resolution priority: 1. NODE_EXTRA_CA_CERTS env var (explicit user config) 2. SSL_CERT_FILE env var 3. /etc/ssl/certs/ca-certificates.crt (Debian/Ubuntu/Alpine) 4. /etc/pki/tls/certs/ca-bundle.crt (RHEL/CentOS/Fedora) Mounts to /custom-ca/ rather than the system default to avoid overwriting the container's own certificates. When no CA bundle is found, the Docker command is unchanged (no regression for github.com users). Fixes anthropics#1129. Co-Authored-By: Claude Sonnet 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.
Problem
On GHES with internal/corporate CAs, the GitHub MCP server Docker container fails every API call:
The container starts without the host's CA bundle, so it can't trust the GHES server's TLS certificate. There is no workaround — the action is non-functional on any GHES instance using an internal CA. Fixes #1129.
Root cause
install-mcp-server.tsbuilds the Docker command without any volume mounts for CA certificates. The self-hosted runner trusts the GHES server (it communicates with it for job dispatch), but that trust material isn't passed into the container.Fix
Resolve the host's CA bundle by checking (in priority order):
NODE_EXTRA_CA_CERTSenv var (explicit user config, highest priority)SSL_CERT_FILEenv var/etc/ssl/certs/ca-certificates.crt(Debian/Ubuntu/Alpine)/etc/pki/tls/certs/ca-bundle.crt(RHEL/CentOS/Fedora)When found, mount it read-only into the container at
/custom-ca/ca-bundle.crtand setSSL_CERT_FILEso the Go binary uses it. The GitHub MCP server image is a Go binary that respectsSSL_CERT_FILEfor custom CA locations.Mounts to
/custom-ca/rather than the system default to avoid overwriting the container's own certificates. When no CA bundle is found on the host, the Docker command is unchanged — no regression for github.com users.Testing
bun test: 653 pass, 0 fail. No logic changes to existing MCP server setup paths.