Skip to content

Commit

Permalink
remove deprecated function,
Browse files Browse the repository at this point in the history
create socket using contex
  • Loading branch information
szymonjas committed Jun 18, 2024
1 parent a414ff8 commit 3087b4c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion splunklib/binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,8 @@ def connect(self):
"""
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if self.scheme == "https":
sock = ssl.wrap_socket(sock)
context = ssl.create_default_context()
sock = context.wrap_socket(sock, server_hostname=self.host)
sock.connect((socket.gethostbyname(self.host), self.port))
return sock

Expand Down

0 comments on commit 3087b4c

Please sign in to comment.