How do I make an HTTPS call in a Busybox Docker container running Go?

Viewed 11220

I am trying to make an HTTPS call in a Docker container running a Go binary. This gives me the following error:

x509: failed to load system roots and no roots provided

Having looked this up, it seems the problem is that the BusyBox docker image does not have a root CA certificate. From other answers on StackOverflow it seems that the best approach is to mount the CA root into the /etc/ssl/certs container directory.

To test locally, it makes sense to mount the host machine's root CA certificate. When running in production (I use Google Container Engine), I'm not sure how to specify a root CA certificate. Do I need to create one myself? Or is there an existing cert in GKE that I can reuse?

2 Answers
Related