diff --git a/splunklib/binding.py b/splunklib/binding.py index b0ed20e1b..0bca6e045 100644 --- a/splunklib/binding.py +++ b/splunklib/binding.py @@ -1368,7 +1368,11 @@ def connect(scheme, host, port): if cert_file is not None: kwargs['cert_file'] = cert_file if not verify: - kwargs['context'] = ssl._create_unverified_context() + try: + kwargs['context'] = ssl._create_unverified_context() + except AttributeError: + # Legacy Python that doesn't support verify PEP 476 + pass return six.moves.http_client.HTTPSConnection(host, port, **kwargs) raise ValueError("unsupported scheme: %s" % scheme)