Skip to content

Commit daf1bcd

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
# Conflicts: # .github/workflows/test.yml
2 parents 2b90307 + c6f7d32 commit daf1bcd

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

splunklib/binding.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@ class Context:
465465
:type scheme: "https" or "http"
466466
:param verify: Enable (True) or disable (False) SSL verification for https connections.
467467
:type verify: ``Boolean``
468-
:param self_signed_certificate: Specifies if self signed certificate is used
469-
:type self_signed_certificate: ``Boolean``
470468
:param sharing: The sharing mode for the namespace (the default is "user").
471469
:type sharing: "global", "system", "app", or "user"
472470
:param owner: The owner context of the namespace (optional, the default is "None").
@@ -528,7 +526,6 @@ def __init__(self, handler=None, **kwargs):
528526
self.bearerToken = kwargs.get("splunkToken", "")
529527
self.autologin = kwargs.get("autologin", False)
530528
self.additional_headers = kwargs.get("headers", [])
531-
self._self_signed_certificate = kwargs.get("self_signed_certificate", True)
532529

533530
# Store any cookies in the self.http._cookies dict
534531
if "cookie" in kwargs and kwargs['cookie'] not in [None, _NoAuthenticationToken]:
@@ -607,11 +604,7 @@ def connect(self):
607604
"""
608605
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
609606
if self.scheme == "https":
610-
context = ssl.create_default_context()
611-
context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1
612-
context.check_hostname = not self._self_signed_certificate
613-
context.verify_mode = ssl.CERT_NONE if self._self_signed_certificate else ssl.CERT_REQUIRED
614-
sock = context.wrap_socket(sock, server_hostname=self.host)
607+
sock = ssl.wrap_socket(sock)
615608
sock.connect((socket.gethostbyname(self.host), self.port))
616609
return sock
617610

0 commit comments

Comments
 (0)