You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS: honor SSL_CERT_FILE so gh can verify TLS against a custom CA bundle (enterprise CA / sandboxes without trustd) #13676
On macOS, Go's crypto/x509 defers certificate verification to Security.framework (the trustd mach service) whenever tls.Config.RootCAs is nil, and — unlike Linux — Go on macOS does not honor SSL_CERT_FILE/SSL_CERT_DIR. That leaves no way to point gh at an explicit CA bundle, which breaks two real scenarios with the same root cause:
trustd unreachable — in sandboxed environments (some agent/CI sandboxes) the mach service is blocked, so everygh HTTPS call (REST, GraphQL, auth) fails with x509 verification errors, with no escape hatch.
Expected behavior
A documented env var (SSL_CERT_FILE, matching the Linux/OpenSSL convention) lets gh verify TLS against an explicit PEM CA bundle without relying on trustd or the system store.
Proposed fix
At startup, if SSL_CERT_FILE (or a GH_-prefixed variant) is set, load the PEM into an x509.CertPool and set it as RootCAs on a clone of http.DefaultTransport. A non-nil RootCAs forces Go's pure-Go verifier, bypassing trustd. No-op when unset; everything built via go-gh's api.NewHTTPClient inherits http.DefaultTransport, so all clients pick it up.
Reference implementation
We implemented this in a fork as a single init() honoring GH_SSL_CERT_FILE/SSL_CERT_FILE: rexovasgroup#51. Happy to open a PR upstream if there's interest.
Thanks for your feedback and example implementation, @davidlovas! 🙏
As you already pointed out, this has been tracked in #1735. So, I'm going to close this as a duplicate of that. Please feel free to share your thoughts/experience on that thread (especially the trustd access issue which is a rather new aspect to this), so that we can have them in one place.
Activity
babakks commentedon Jun 19, 2026
Thanks for your feedback and example implementation, @davidlovas! 🙏
As you already pointed out, this has been tracked in #1735. So, I'm going to close this as a duplicate of that. Please feel free to share your thoughts/experience on that thread (especially the
trustdaccess issue which is a rather new aspect to this), so that we can have them in one place.justinmchase commentedon Sep 29, 2026
This is a pretty major issue. It completely blocks me inside our corporate vnet.