Skip to content

fix: embed CA certificates for environments without system certs#238

Merged
TimPietruskyRunPod merged 1 commit intomainfrom
fix/embed-ca-certs
Mar 3, 2026
Merged

fix: embed CA certificates for environments without system certs#238
TimPietruskyRunPod merged 1 commit intomainfrom
fix/embed-ca-certs

Conversation

@TimPietruskyRunPod
Copy link
Member

Summary

  • Import golang.org/x/crypto/x509roots/fallback to embed Mozilla's CA certificate bundle in the binary
  • This allows runpodctl to make HTTPS calls in environments without ca-certificates installed (e.g. minimal Docker images like ubuntu:22.04)
  • When system certs are available, they are used as normal — the embedded bundle is only a fallback
  • Binary size increase: ~200KB

The problem

Running runpodctl from inside a container based on a minimal image (without ca-certificates) fails:

Error: Post "https://api.runpod.io/graphql": tls: failed to verify certificate: x509: certificate signed by unknown authority

Verified

Tested on a live Runpod pod:

  1. Removed ca-certificates from a running pod to simulate bare ubuntu:22.04
  2. Old binary → x509: certificate signed by unknown authority
  3. New binary (with embedded certs) → TLS succeeds, gets 401 (expected with fake API key)

Fixes #149

@justinwlin justinwlin self-requested a review February 26, 2026 16:05
@TimPietruskyRunPod TimPietruskyRunPod merged commit eb63246 into main Mar 3, 2026
1 check passed
@TimPietruskyRunPod TimPietruskyRunPod deleted the fix/embed-ca-certs branch March 3, 2026 10:14
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.

runpodctl from pod - certificate signed by unkown authority

2 participants