title: cannot validate certificate for <ip-address> because it doesn't contain any IP SANs
body: <p>I'm working on a GitLab CI pipeline that will deploy my docker stack. I'm trying to set the $DOCKER_HOST to be <code>tcp://DROPLET_IP:2377</code>, but I'm getting an error saying that my certificate does doesn't contain any IP SANs. I'm testing with a Digital Ocean Droplet, so I haven't set a domain name for my droplet yet. </p>
  
  <pre><code>deploy:
    stage: deploy
    image: docker:stable
    services:
      - docker:dind
    variables:
      DOCKER_HOST: "tcp://$DROPLET_IP:2377"
      DOCKER_TLS_VERIFY: 1
    before_script:
      - mkdir -p ~/.docker
      - echo "$TLS_CA_CERT" &gt; ~/.docker/ca.pem
      - echo "$TLS_CERT" &gt; ~/.docker/cert.pem
      - echo "$TLS_KEY" &gt; ~/.docker/key.pem
    script:
      - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
      - docker info
      - docker stack deploy --with-registry-auth --compose-file=docker-stack.yml mystack
  </code></pre>
  
  <p>Here's the error I'm getting in the output of my GitLab CI job:</p>
  
  <pre><code>$ docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
  WARNING! Using --password via the CLI is insecure. Use --password-stdin.
  error during connect: Post https://&lt;ip-address&gt;:2377/v1.39/auth: x509: cannot validate certificate for &lt;ip-address&gt; because it doesn't contain any IP SANs
  </code></pre>
  
  <p>I'm using the following set of commands to generate my certs (<code>ca.pem</code>, <code>server-cert.pem</code> and <code>server-key.pem</code>) that I'm trying to use in my <code>deploy</code> stage described above. I have saved <code>TLS_CA_CERT</code>, <code>TLS_CERT</code> and <code>TLS_KEY</code> to variables that are being used in GitLab CI. </p>
  
  <pre><code>openssl genrsa -aes256 -out ca-key.pem 4096
  
  openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem
  
  openssl genrsa -out server-key.pem 4096
  
  openssl req -subj "/CN=&lt;ip-address&gt;" -sha256 -new -key server-key.pem -out server.csr
  
  echo subjectAltName = IP:&lt;ip-address&gt; &gt;&gt; extfile.cnf
  
  echo extendedKeyUsage = serverAuth &gt;&gt; extfile.cnf
  
  openssl x509 -req -days 365 -sha256 -in server.csr -CA ca.pem -CAkey ca-key.pem \
    -CAcreateserial -out server-cert.pem -extfile extfile.cnf
  </code></pre>