title: Docker Registry behind TLS enabled reverse proxy (Traefik) - Remote Error: Bad Certificate
body: <p>So I am doing everything Dockerized here. Traefik is running in a container, as is my docker Registry instance. I am able to push/pull just fine from the registry if I hit it at <code>mydomain.com:5000/myimage</code>. </p>
  
  <p>The problem comes when I try to hit it through 443 using <code>mydomain.com/myimage</code>. The setup I have here is Traefik reverse proxy listening on 443 at <code>mydomain.com</code>, and forwarding that request internally to <code>:5000</code> of my Registry instance. </p>
  
  <p>When I go to push/pull from the Traefik url, it hangs and counts down waiting to retry on a loop. When I look at the logs of Registry, each I can see the instance IS in fact in communication with the reverse proxy Traefik, however, I get this error in the log over and over (on each push retry from the client side):</p>
  
  <p><code>2018/05/31 21:10:43 http: TLS handshake error from proxy_container_ip:port: remote error: tls: bad certificate</code></p>
  
  <p>Docker Registry is really tight and strict when it comes to the TLS issue. I'm using all self signed certs here, as I'm still in development. <strong>Any idea what is causing this error?</strong> I'm assuming that either the Traefik proxy detects that the certificate offered from Registry is not to be trusted (self-signed), and therefore does not complete the "push" request, or the other way around - Registry, when sending the response back through to the Traefik proxy detects that it is not to be trusted.</p>
  
  <p>I can provide additional information if needed. Current setup is that both Traefik and Registry have their own set of .crt and .key files. Both (of course) TLS enabled.</p>
  
  <p>Thanks.</p>