Answers: <p>It seems you have missed DNS. First, don't reference the device by IP, instead use a FQDN. If you need, you can set an entry for 192.168.99.100 in /etc/hosts for now. Secondly, type "hostname" on the node and verify it does not return "localhost" (it likely will). Then type "hostnamectl set-hostname newhostname.fullyqualified.com" and then <a href="https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/" rel="nofollow noreferrer">regenerate and re-sign the certificate.</a></p>
  
Answers: CC BY-SA 3.0
Answers: 2017-09-06T14:09:53.113Z
Answers: 2017-09-06T14:09:53.113Z
Answers: James Shewey
Answers: <p>I don't have a proper solution to fix the certs, but a work-around is to make docker-compose not care about the mismatch as follows:
  <code>
  CURL_CA_BUNDLE= docker-compose up
  </code></p>
  
Answers: CC BY-SA 4.0
Answers: 2018-11-29T20:36:03.787Z
Answers: 2018-11-29T20:36:03.787Z
Answers: Lorrin
Body: <p>I have a complete docker stack (<a href="https://github.com/carlosas/docker-for-symfony-3" rel="nofollow noreferrer">source</a>) which uses docker-compose.</p>
  
  <p>It works fine by its own, but now I'm trying to deploy it in Kubernetes' Minikube and when after <code>eval $(minikube docker-env)</code> I try to run <code>docker-compose up</code>, it throws the following error:</p>
  
  <blockquote>
    <p>backports.ssl_match_hostname.CertificateError: hostname '192.168.99.100' doesn't match 'localhost'</p>
  </blockquote>
  
  <p>What am I missing?</p>
  
  <hr>
  
  <p>This is the complete trace:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):</p>
    
    <p>File "/usr/bin/docker-compose", line 9, in 
        load_entry_point('docker-compose==1.8.0', 'console_scripts', 'docker-compose')()</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 61, in main
        command()</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 113, in perform_command
        handler(command, command_options)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 835, in up
        remove_orphans=remove_orphans)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/compose/project.py", line 372, in up
        warn_for_swarm_mode(self.client)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/compose/project.py", line 539, in warn_for_swarm_mode
        info = client.info()</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/docker/api/daemon.py", line 33, in info
        return self._result(self._get(self._url("/info")), True)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/docker/utils/decorators.py", line 47, in inner
        return f(self, *args, **kwargs)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/docker/client.py", line 140, in _get
        return self.get(url, **self._set_request_timeout(kwargs))</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 480, in get
        return self.request('GET', url, **kwargs)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 468, in request
        resp = self.send(prep, **send_kwargs)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send
        r = adapter.send(request, **kwargs)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 376, in send
        timeout=timeout</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 560, in urlopen
        body=body, headers=headers)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 346, in _make_request
        self._validate_conn(conn)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 787, in _validate_conn
        conn.connect()</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/urllib3/connection.py", line 277, in connect
        match_hostname(cert, asserted_hostname)</p>
    
    <p>File "/usr/lib/python2.7/dist-packages/backports/ssl_match_hostname/<strong>init</strong>.py", line 99, in match_hostname
        % (hostname, dnsnames[0]))</p>
    
    <p>backports.ssl_match_hostname.CertificateError: hostname '192.168.99.100' doesn't match 'localhost'</p>
  </blockquote>
  
Comments: CC BY-SA 3.0
Comments: 2017-09-06T08:35:57.427Z
Comments: Posibly related: https://github.com/kubernetes/minikube/pull/225
Comments: CarlosAS
Tags: <docker><kubernetes><docker-compose>
Title: Docker-compose + Kubernetes: backports.ssl_match_hostname.CertificateError
UserDisplayName: CarlosAS
ThreadText: # Docker-compose + Kubernetes: backports.ssl_match_hostname.CertificateError
  
  (Asked by: username_0 on 2017-09-06)
  
  I have a complete docker stack ([source](https://github.com/username_0/docker-for-symfony-3)) which uses docker-compose.
  
  It works fine by its own, but now I'm trying to deploy it in Kubernetes' Minikube and when after `eval $(minikube docker-env)` I try to run `docker-compose up`, it throws the following error:
  
  > backports.ssl\_match\_hostname.CertificateError: hostname '192.168.99.100' doesn't match 'localhost'
  
  What am I missing?
  
  ---
  
  This is the complete trace:
  
  > Traceback (most recent call last):
  >
  > File "/usr/bin/docker-compose", line 9, in
  > load\_entry\_point('docker-compose==1.8.0', 'console\_scripts', 'docker-compose')()
  >
  > File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 61, in main
  > command()
  >
  > File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 113, in perform\_command
  > handler(command, command\_options)
  >
  > File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 835, in up
  > remove\_orphans=remove\_orphans)
  >
  > File "/usr/lib/python2.7/dist-packages/compose/project.py", line 372, in up
  > warn\_for\_swarm\_mode(self.client)
  >
  > File "/usr/lib/python2.7/dist-packages/compose/project.py", line 539, in warn\_for\_swarm\_mode
  > info = client.info()
  >
  > File "/usr/lib/python2.7/dist-packages/docker/api/daemon.py", line 33, in info
  > return self.\_result(self.\_get(self.\_url("/info")), True)
  >
  > File "/usr/lib/python2.7/dist-packages/docker/utils/decorators.py", line 47, in inner
  > return f(self, \*args, \*\*kwargs)
  >
  > File "/usr/lib/python2.7/dist-packages/docker/client.py", line 140, in \_get
  > return self.get(url, \*\*self.\_set\_request\_timeout(kwargs))
  >
  > File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 480, in get
  > return self.request('GET', url, \*\*kwargs)
  >
  > File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 468, in request
  > resp = self.send(prep, \*\*send\_kwargs)
  >
  > File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send
  > r = adapter.send(request, \*\*kwargs)
  >
  > File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 376, in send
  > timeout=timeout
  >
  > File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 560, in urlopen
  > body=body, headers=headers)
  >
  > File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 346, in \_make\_request
  > self.\_validate\_conn(conn)
  >
  > File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 787, in \_validate\_conn
  > conn.connect()
  >
  > File "/usr/lib/python2.7/dist-packages/urllib3/connection.py", line 277, in connect
  > match\_hostname(cert, asserted\_hostname)
  >
  > File "/usr/lib/python2.7/dist-packages/backports/ssl\_match\_hostname/**init**.py", line 99, in match\_hostname
  > % (hostname, dnsnames[0]))
  >
  > backports.ssl\_match\_hostname.CertificateError: hostname '192.168.99.100' doesn't match 'localhost'
  
  **Tags:** docker, kubernetes, docker-compose
  
  > **Comments:**
  > **username_0**: Posibly related: https://github.com/kubernetes/minikube/pull/225  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-09-06. Score: 1
  
  It seems you have missed DNS. First, don't reference the device by IP, instead use a FQDN. If you need, you can set an entry for 192.168.99.100 in /etc/hosts for now. Secondly, type "hostname" on the node and verify it does not return "localhost" (it likely will). Then type "hostnamectl set-hostname newhostname.fullyqualified.com" and then [regenerate and re-sign the certificate.](https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/)
  
  
  ---
  
  ### Answer by username_2 on 2018-11-29. Score: 0
  
  I don't have a proper solution to fix the certs, but a work-around is to make docker-compose not care about the mismatch as follows:
  `CURL_CA_BUNDLE= docker-compose up`
  
  
  ---
  
  