title: What is the meaning of error=x509: certificate is valid for user A, not localhost in Docker?
body: <p>I am using a Docker container to run a bunch of services, all of those services make use of certificates to communicate to each other. </p>
  
  <p>When starting up those services there is one in concrete that complains with the following error</p>
  
  <pre><code>&gt; discovery_1 | INFO ttn: Got public keys for token validation
  &gt; discovery_1 | DEBUG Connected to gRPC server Address=localhost:1900
  &gt; discovery_1 | FATAL Could not start client for gRPC proxy error=x509: certificate is valid for discovery, not localhost
  &gt; ttnbackbone_discovery_1 exited with code 1
  </code></pre>
  
  <p>I have created the certificate for "discovery" user but still Docker runs it for the localhost, in some way, which I don't understand... I have also followed <a href="https://docs.docker.com/registry/insecure/" rel="nofollow noreferrer">this tutorial of certificates usage</a> from Docker but still I have the same error.</p>
  
  <p>What can I do further?</p>
  
  <p>THanks in advance,</p>
  
  <p>REgards!</p>