how to add a trusted CA for local Consul docker container

Viewed 19

how to add a trusted CA for local Consul docker container? So I have a consul running as a docker container and I am able to access it using chrome at localhost:8500 after exposing the ports, as expected. But due to company setting there is a security CA being added that chrome trusts, since it is added to MacOS keychain, but consul does not seems to trust when I try to use golang library to connect to consul

x509: “Menlo Security Intermediate CA” certificate is not trusted"

I get a certificate is not trusted error. I am able to export the CA to a RootCA.cer file from the keychain but how do I configure consul image to trust this CA file?

https://iotech.force.com/edgexpert/s/article/secure-consul-tls I see articles like this

ca_file is used to check the authenticity of the client and server connections
cert_file is provided to clients and server to verify the agent's authenticity
key_file is used with the certificate to verify the agent's authenticity

but for me, the .cer export file will be used as cert_file? how should I do it in docker compose?

  consul:
  image: dockerproxy.comp.com/consul:latest
  ports:
    - "9500:9500"
0 Answers
Related