python: SSL verification on python2.7 failing
I saw a commit flying by that said this was fixed but I get:
>>> import os
>>> config.load_kube_config(os.environ["HOME"] + '/.kube/config')
>>> v1=client.CoreV1Api()
>>> ret = v1.list_pod_for_all_namespaces(watch=False)
2016-11-23 10:26:29,195 ERROR Certificate did not match expected hostname: 192.168.99.100. Certificate: {'subjectAltName': (('DNS', 'kubernetes.default.svc.cluster.local'), ('DNS', 'kubernetes.default.svc'), ('DNS', 'kubernetes.default'), ('DNS', 'kubernetes'), ('IP Address', '192.168.99.100'), ('IP Address', '10.0.0.1')), 'notBefore': u'Nov 16 09:38:49 2016 GMT', 'serialNumber': u'02', 'notAfter': 'Nov 16 09:38:49 2017 GMT', 'version': 3L, 'subject': ((('commonName', u'minikube'),),), 'issuer': ((('commonName', u'minikubeCA'),),)}
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "kubernetes/client/apis/core_v1_api.py", line 14377, in list_pod_for_all_namespaces
    (data) = self.list_pod_for_all_namespaces_with_http_info(**kwargs)
  File "kubernetes/client/apis/core_v1_api.py", line 14475, in list_pod_for_all_namespaces_with_http_info
    collection_formats=collection_formats)
  File "kubernetes/client/api_client.py", line 326, in call_api
    _return_http_data_only, collection_formats, _preload_content, _request_timeout)
  File "kubernetes/client/api_client.py", line 150, in __call_api
    _request_timeout=_request_timeout)
  File "kubernetes/client/api_client.py", line 349, in request
    headers=headers)
  File "kubernetes/client/rest.py", line 222, in GET
    query_params=query_params)
  File "kubernetes/client/rest.py", line 199, in request
    raise ApiException(status=0, reason=msg)
kubernetes.client.rest.ApiException: (0)
Reason: SSLError
hostname '192.168.99.100' doesn't match either of 'kubernetes.default.svc.cluster.local', 'kubernetes.default.svc', 'kubernetes.default', 'kubernetes', '192.168.99.100', '10.0.0.1'
About this issue
- Original URL
 - State: closed
 - Created 8 years ago
 - Comments: 22 (11 by maintainers)
 
Commits related to this issue
- Merge pull request #36 from lichen2013/keep_watch Keep the watch action working forever — committed to yliaog/client-python by mbohlool 6 years ago
 
this works for me
I figured this out. We had a patch that we removed because urllib3 is already doing the patch, however it only does that if package “ipaddress” is installed. I added that as a dependency so we should be good.
Hey
Thanks On Sun, May 28, 2017 at 9:10 AM Mehdy Bohlool notifications@github.com wrote:
– Madhav Malhotra Graduate Student University of Victoria Canada +1-778-922-5630