title: x509: certificate is valid for *.xyz.net, not docker.abc.xyz.net
body: <p>I am trying to login to a company's private docker repository. When I try to login with:</p>
  
  <pre><code>docker login docker.abc.xyz.net
  </code></pre>
  
  <p>it returns only this error:</p>
  
  <pre><code>Error response from daemon: Get https://docker.abc.xyz.net/v1/users/: x509:  certificate is valid for *.xyz.net, xyg.net, not docker.abc.xyz.net
  </code></pre>
  
  <p>We have a <code>ca.cert</code>, which I have put at the following location:</p>
  
  <pre><code>/Users/myName/etc/docker/certs.d/docker.abc.xyz.net/ca.cert
  </code></pre>
  
  <p>I also tried putting it here:</p>
  
  <pre><code>/private/etc/docker/certs.d/docker.abc.xyz.net/ca.cert
  </code></pre>
  
  <p>and finally used this command to try to get keychain access for the cert:</p>
  
  <pre><code>sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.crt
  </code></pre>
  
  <p>I even gave full access to the cert to see if that would be picked up. I have tried restarting docker as well, but nothing is accepting my certificate. Does anyone else have any ideas what might be preventing the login attempt on Docker Mac?</p>
  
  <pre><code>--------------
  Certificate:
      Data:
          Version: 3 (0x2)
          Serial Number:
              6c:ac:dd:00:bf:96:38:c3
          Signature Algorithm: sha256WithRSAEncryption
          Issuer: CN=ON DWCC Unclass Testing CA-1
          Validity
              Not Before: Jun  6 19:40:49 2016 GMT
              Not After : Jun  6 19:40:49 2018 GMT
          Subject: C=US, O=Navy, OU=ONI, CN=docker.abc.xyz.net
          Subject Public Key Info:
              Public Key Algorithm: rsaEncryption
              RSA Public Key: (2048 bit)
                  Modulus (2048 bit):
  
                  Exponent: 65537 (0x10001)
          X509v3 extensions:
              X509v3 Subject Key Identifier: 
  
              X509v3 Basic Constraints: critical
                  CA:FALSE
              X509v3 Authority Key Identifier: 
                  keyid:
  
              X509v3 Key Usage: critical
                  Digital Signature, Key Encipherment
              X509v3 Extended Key Usage: 
                  TLS Web Server Authentication, TLS Web Client Authentication
              X509v3 Subject Alternative Name: 
                  DNS:docker.abc.xyz.net
      Signature Algorithm: sha256WithRSAEncryption
  </code></pre>