Skip to content

Commit 84eeeed

Browse files
author
Scott Odle
committed
don't check for ssl support if we're not verifying anyway
1 parent fb416b5 commit 84eeeed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

splunklib/binding.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ def connect(self):
552552
socket.write("\\r\\n")
553553
"""
554554
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
555-
if self.scheme == "https":
556-
if hasssl and self.verify:
555+
if self.scheme == "https" and self.verify:
556+
if hasssl:
557557
sock = ssl.wrap_socket(sock)
558558
else:
559559
raise ImportError('No SSL library found')
@@ -1343,8 +1343,8 @@ def connect(scheme, host, port):
13431343
if timeout is not None: kwargs['timeout'] = timeout
13441344
if scheme == "http":
13451345
return six.moves.http_client.HTTPConnection(host, port, **kwargs)
1346-
if scheme == "https":
1347-
if hasssl and verify:
1346+
if scheme == "https" and verify:
1347+
if hasssl:
13481348
if key_file is not None: kwargs['key_file'] = key_file
13491349
if cert_file is not None: kwargs['cert_file'] = cert_file
13501350

0 commit comments

Comments
 (0)