@@ -465,8 +465,6 @@ class Context:
465
465
:type scheme: "https" or "http"
466
466
:param verify: Enable (True) or disable (False) SSL verification for https connections.
467
467
:type verify: ``Boolean``
468
- :param self_signed_certificate: Specifies if self signed certificate is used
469
- :type self_signed_certificate: ``Boolean``
470
468
:param sharing: The sharing mode for the namespace (the default is "user").
471
469
:type sharing: "global", "system", "app", or "user"
472
470
:param owner: The owner context of the namespace (optional, the default is "None").
@@ -528,7 +526,6 @@ def __init__(self, handler=None, **kwargs):
528
526
self .bearerToken = kwargs .get ("splunkToken" , "" )
529
527
self .autologin = kwargs .get ("autologin" , False )
530
528
self .additional_headers = kwargs .get ("headers" , [])
531
- self ._self_signed_certificate = kwargs .get ("self_signed_certificate" , True )
532
529
533
530
# Store any cookies in the self.http._cookies dict
534
531
if "cookie" in kwargs and kwargs ['cookie' ] not in [None , _NoAuthenticationToken ]:
@@ -607,11 +604,7 @@ def connect(self):
607
604
"""
608
605
sock = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
609
606
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 )
615
608
sock .connect ((socket .gethostbyname (self .host ), self .port ))
616
609
return sock
617
610
0 commit comments