Fix kubectl, Helm & Minikube x509 Unknown Authority on Mac
Fix kubectl, Helm & Minikube x509: certificate signed by unknown authority errors behind Zscaler, Cloudflare WARP, or Netskope on macOS safely.
SWG bar · Updated
When running kubectl get pods, helm repo update, helm pull, or minikube start on a corporate Mac behind Zscaler, Cloudflare WARP, Netskope, Cisco Umbrella, Palo Alto GlobalProtect, or Fortinet, Kubernetes CLI and container-runtime commands frequently abort during TLS verification with errors like:
# kubectl (remote API server or OIDC token exchange)
Unable to connect to the server: tls: failed to verify certificate:
x509: certificate signed by unknown authority
# Helm (chart repository or OCI registry)
Error: looks like "https://charts.bitnami.com/bitnami" is not a valid chart repository or cannot be reached:
Get "https://charts.bitnami.com/bitnami/index.yaml": tls: failed to verify certificate:
x509: certificate signed by unknown authority
# Minikube (containerd pulling control-plane or workload images inside the node VM)
Exiting due to GUEST_IMAGE_PULL: Failed to pull image "registry.k8s.io/kube-apiserver:v1.31.0":
tls: failed to verify certificate: x509: certificate signed by unknown authority
Paste your exact terminal log into the free SWG & SSL Error Decoder to pinpoint which layer rejected the chain, or follow the upgrade-safe macOS fix below.
1. Why kubectl, Helm & Minikube reject corporate SWG certificates
Safari and Chrome validate TLS certificates through macOS System Keychain, where MDM installs your company’s SWG Root CA. Kubernetes tooling crosses three separate trust boundaries that browsers never hit:
kubectl&~/.kube/configCA pinning: When a cluster context specifiescertificate-authority-data(orcertificate-authority),kubectlvalidates the Kubernetes API server strictly against that cluster CA—not macOS Keychain. If an SWG breaks and re-signs HTTPS traffic to a remote API server (*.eks.amazonaws.com,*.azmk8s.io, GKE, or private clusters) or to your OIDC identity provider,kubectlimmediately rejects the re-signed certificate. In addition, ifSSL_CERT_FILEis already set in your shell to an incomplete PEM file, Go’scrypto/x509skips macOS Keychain for OIDC and cloud-auth exec plugins as well.- Helm (
helm repo& OCI registries): Helm is a Go CLI backed bycrypto/x509. SettingSSL_CERT_FILEto a partial certificate bundle overrides macOS Keychain lookup and breaks chart repositories (charts.bitnami.com) and OCI registries (ghcr.io,registry-1.docker.io). - Minikube (macOS host CLI + Linux VM/container runtime): Minikube runs
containerdandkubeletinside a Linux VM or Docker container whose trust store lives in Linux/etc/ssl/certs. That guest Linux environment cannot read macOS System Keychain, sominikube startand pod pulls fail withGUEST_IMAGE_PULLorImagePullBackOffwhenever an SWG interceptsregistry.k8s.io,gcr.io,ghcr.io, ordocker.io.
Inspect your current TLS environment and active context first:
env | grep -E 'SSL_CERT|CURL_CA|KUBECONFIG|HELM_|HTTPS_PROXY|NO_PROXY'
kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}' ; echo
helm version --short && minikube version --short
Never point SSL_CERT_FILE at only your corporate SWG root CA—doing so breaks every non-inspected public endpoint for Go-based CLIs.
2. Build an upgrade-safe combined macOS + corporate SWG CA bundle
Create a combined PEM bundle in ~/.certs/k8s-combined-ca.pem containing Apple’s built-in trusted public root CAs plus your corporate SWG Root CA, and also export a standalone .crt file into ~/.minikube/certs/ for Minikube’s guest node:
mkdir -p "$HOME/.certs" "$HOME/.minikube/certs"
# 1. Export Apple's built-in trusted public root CAs
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain > "$HOME/.certs/k8s-combined-ca.pem"
# 2. Append your corporate SWG Root CA (replace "Zscaler" with Cloudflare, goskope, Cisco Umbrella, Fortinet, etc.)
security find-certificate -c "Zscaler" -p /Library/Keychains/System.keychain >> "$HOME/.certs/k8s-combined-ca.pem"
# 3. Export the standalone corporate SWG Root CA as .crt for Minikube's Linux node
security find-certificate -c "Zscaler" -p /Library/Keychains/System.keychain > "$HOME/.minikube/certs/corporate-swg-ca.crt"
Because ~/.certs/k8s-combined-ca.pem includes both standard public roots and your corporate SWG root, inspected registries and direct endpoints both validate cleanly across Homebrew and CLI upgrades.
3. Persist CA trust for kubectl, Helm & Minikube
Export SSL_CERT_FILE and CURL_CA_BUNDLE in ~/.zshrc so kubectl, helm, minikube, and cloud auth helpers (aws-iam-authenticator, gke-gcloud-auth-plugin, kubelogin) all load the combined trust bundle:
cat <<'EOF' >> ~/.zshrc
export SSL_CERT_FILE="$HOME/.certs/k8s-combined-ca.pem"
export CURL_CA_BUNDLE="$HOME/.certs/k8s-combined-ca.pem"
EOF
source ~/.zshrc
Next, apply tool-specific persistent settings:
- Helm: Pass
--ca-filewhen adding an inspected chart repository (Helm saves the CA reference inrepositories.yamlfor futurehelm repo updateruns):helm repo add bitnami https://charts.bitnami.com/bitnami --ca-file "$HOME/.certs/k8s-combined-ca.pem" helm repo update - Minikube: Start (or recreate) your cluster with
--embed-certsso Minikube installs every.crtfile from~/.minikube/certs/into the guest Linux OS trust store andcontainerd/ Docker runtime:
If your Mac also setsminikube start --embed-certsHTTP_PROXY/HTTPS_PROXY, ensure local Minikube addresses stay excluded inNO_PROXY(for exampleexport NO_PROXY="127.0.0.1,localhost,192.168.49.0/24,10.96.0.0/12") so your corporate proxy does not intercept the local control plane.
Verify all three tools with full TLS verification enabled—never disable verification (kubectl --insecure-skip-tls-verify, insecure-skip-tls-verify: true in ~/.kube/config, helm --insecure-skip-tls-verify, curl -k, or NODE_TLS_REJECT_UNAUTHORIZED=0):
kubectl cluster-info
helm search repo bitnami/nginx
minikube kubectl -- get nodes
4. Handle kubeconfig mTLS, cluster CA pinning & GUI Kubernetes clients
Two common scenarios remain broken even after configuring SSL_CERT_FILE:
- Cluster CA pinning & client-certificate mTLS on remote API servers: Many Kubernetes clusters authenticate
kubectlwith mutual TLS (client-certificate-data/client-key-data) and pin a cluster-specific CA incertificate-authority-data. An SWG performing HTTPS break-and-inspect cannot forge the cluster’s private CA or relay mTLS client certificates cleanly. Those API server hostnames must bypass SWG decryption rather than trusting an SWG root CA. - GUI Kubernetes apps & IDE plugins: If
kubectlandhelmsucceed in Terminal but fail inside Lens / OpenLens, VS Code Kubernetes, or IntelliJ, GUI apps did not load~/.zshrc. Export the CA bundle for the current macOS login session and restart the app:launchctl setenv SSL_CERT_FILE "$HOME/.certs/k8s-combined-ca.pem" launchctl setenv CURL_CA_BUNDLE "$HOME/.certs/k8s-combined-ca.pem"
5. Avoid kubeconfig CA conflicts & VM cert drift with per-domain SWG bypass
Rebuilding Minikube nodes whenever a corporate SWG rotates intermediate certificates—or working around mTLS and certificate-authority-data pinning on remote clusters—quickly turns into recurring maintenance. Where your company’s policy permits per-domain SWG bypass for container registries and cluster endpoints, SWG bar detects which hosts are intercepted and restores the authentic TLS certificate per domain without turning off your corporate VPN or SSO (includes a 14 actual-use-day free trial):
swgbar probe registry.k8s.io
swgbar bypass enable registry.k8s.io
swgbar bypass enable charts.bitnami.com
swgbar bypass enable ghcr.io
Troubleshooting Docker pulls or pinned TLS endpoints on the same corporate Mac? Continue with Fix Python CERTIFICATE_VERIFY_FAILED & Docker x509 errors on Mac, Why certificate pinning and mTLS fail under SWG break-and-inspect, and How to bypass SWG on a Mac.