Disable SSL verification for Consul when it is required (#1399)

Consul client uses urllib3 with a verify=True by default. When
SSL verification is disabled with verify=False, we can see
CERTIFICATE_VERIFY_FAILED exceptions. With urllib3 1.19.1-1 on
Debian Stretch, the "cert_reqs" argument  must be explicitaly set
to ssl.CERT_NONE to effectively disable SSL verification.
This commit is contained in:
Julien Riou
2020-02-20 10:13:41 +01:00
committed by GitHub
parent 80ce61876e
commit 7b0e012f62
+2
View File
@@ -55,6 +55,8 @@ class HTTPClient(object):
kwargs['ca_certs'] = ca_cert
if verify or ca_cert:
kwargs['cert_reqs'] = ssl.CERT_REQUIRED
else:
kwargs['cert_reqs'] = ssl.CERT_NONE
self.http = urllib3.PoolManager(num_pools=10, **kwargs)
self._ttl = None