Skip to content

fix: mount host CA certificate bundle into GitHub MCP server container#1169

Open
qozle wants to merge 1 commit intoanthropics:mainfrom
qozle:fix/ghes-docker-ca-certs
Open

fix: mount host CA certificate bundle into GitHub MCP server container#1169
qozle wants to merge 1 commit intoanthropics:mainfrom
qozle:fix/ghes-docker-ca-certs

Conversation

@qozle
Copy link
Copy Markdown
Contributor

@qozle qozle commented Apr 5, 2026

Problem

On GHES with internal/corporate CAs, the GitHub MCP server Docker container fails every API call:

tls: failed to verify certificate: x509: certificate signed by unknown authority

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.ts builds 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):

  1. NODE_EXTRA_CA_CERTS env var (explicit user config, highest priority)
  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)

When found, mount it read-only into the container at /custom-ca/ca-bundle.crt and set SSL_CERT_FILE so the Go binary uses it. The GitHub MCP server image is a Go binary that respects SSL_CERT_FILE for 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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub MCP server fails on GHES with internal CA certificates — no way to configure TLS trust

1 participant