title: how to add a trusted CA for local Consul docker container
body: <p>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</p>
  <pre><code>x509: “Menlo Security Intermediate CA” certificate is not trusted&quot;
  </code></pre>
  <p>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?</p>
  <p><a href="https://iotech.force.com/edgexpert/s/article/secure-consul-tls" rel="nofollow noreferrer">https://iotech.force.com/edgexpert/s/article/secure-consul-tls</a>
  I see articles like this</p>
  <pre><code>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
  </code></pre>
  <p>but for me, the .cer export file will be used as cert_file?
  how should I do it in docker compose?</p>
  <pre><code>  consul:
    image: dockerproxy.comp.com/consul:latest
    ports:
      - &quot;9500:9500&quot;
  </code></pre>