diff --git a/splunklib/binding.py b/splunklib/binding.py index 3fe7c8495..283a0a8c7 100644 --- a/splunklib/binding.py +++ b/splunklib/binding.py @@ -1357,7 +1357,7 @@ def connect(scheme, host, port): if cert_file is not None: kwargs['cert_file'] = cert_file # If running Python 2.7.9+, disable SSL certificate validation - if (sys.version_info >= (2,7,9) and key_file is None and cert_file is None) and not verify: + if (sys.version_info >= (2,7,9) and key_file is None and cert_file is None) or not verify: kwargs['context'] = ssl._create_unverified_context() return six.moves.http_client.HTTPSConnection(host, port, **kwargs) raise ValueError("unsupported scheme: %s" % scheme)