Skip to content

GHES instance with internal certificate throwing "unknown authority" error #381

Description

@Hdom

Hello, we are trying to set up a garm instance connected to an internal GitHub Enterprise Server instance and garm is unable to connect to the github instance due to an unknown authority tls error.

error:

time=2025-05-02T21:35:06.844Z level=INFO source=/workspace/runner/pool/pool.go:1599 msg="running initial tool update"
time=2025-05-02T21:35:06.894Z level=ERROR source=/workspace/runner/pool/pool.go:404 msg="failed to update tools for entity" error="Get \"https://github.internal/api/v3/repos/ORG/repo/actions/runners/downloads\": could not refresh installation id 2's token: could not get access_tokens from GitHub API for installation ID 2: tls: failed to verify certificate: x509: certificate signed by unknown authority\nfetching runner tools\ngithub.com/cloudbase/garm/runner/pool.(*basePoolManager).FetchTools\n\t/workspace/runner/pool/pool.go:1999\ngithub.com/cloudbase/garm/runner/pool.(*basePoolManager).updateTools\n\t/workspace/runner/pool/pool.go:402\ngithub.com/cloudbase/garm/runner/pool.(*basePoolManager).Start.func1\n\t/workspace/runner/pool/pool.go:1600\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1700" entity=UKG-FedRAMP/bst-garm-config
time=2025-05-02T21:35:06.894Z level=ERROR source=/workspace/runner/pool/pool.go:1601 msg="failed to update tools" error="failed to update tools for entity ORG/repo: fetching runner tools: Get \"https://github.internal/api/v3/repos/ORG/repo/actions/runners/downloads\": could not refresh installation id 2's token: could not get access_tokens from GitHub API for installation ID 2: tls: failed to verify certificate: x509: certificate signed by unknown authority"

I have tried everything I could think of:

  • Added Root CA cert, Intermediate CA cert, and host cert to /usr/local/share/ca-certificates and ran update-ca-certificates.
  • Verified that the certificates are present in /etc/ssl/certs once update-ca-certificates is ran.
  • Verified I can curl the instance from within the machine running garm without any issues, certificate is trusted.
  • Tried adding the certs to /usr/share/ca-certificates and updating /etc/ca-certificates.conf as advised by this https://stackoverflow.com/a/74575551.
  • Tried setting ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt and ENV SSL_CERT_DIR=/etc/ssl/certs together and separately. I also tried setting the environment variables directly in the machine (export ...) and directly before executing the garm service (SSL_CERT_DIR=/etc/ssl/certs ./garm -config config.toml).
  • Tried running with and without root permissions.

Runtime details:
Runtime Image: library/ubuntu:22.04
Additional Packages: gettext-base, wget, apt-transport-https, ca-certificates, gnupg, curl, jq, google-cloud-cli, kubectl, google-cloud-sdk-gke-gcloud-auth-plugin, yq

GARM Binary:
Custom garm binary based off v0.1.5.
Builder: Google Cloud Build.
Build Image: golang:1.24-bookworm
Build command:

go build -o $_FILE_NAME \
      -tags osusergo,netgo,sqlite_omit_load_extension \
      -ldflags "-linkmode external -extldflags '-static' -s -w -X main.Version=$(git describe --tags --match='v[0-9]*' --dirty --always)" \
      ./cmd/garm

Any ideas as to what might be causing this?
Could it be an incompatibility between the binary build in debian and running in ubuntu?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions