Skip to content

Commit

Permalink
Use hostname to match ssl cert
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Nuzhnov committed Nov 14, 2023
1 parent f729eb9 commit 5094481
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ch_tools/monrun_checks_keeper/keeper_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,12 @@ def keeper_command(cmd, timeout, verify_ssl_certs):
if not verify_ssl_certs:
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
with context.wrap_socket(sock, server_hostname="localhost") as ssock:
ssock.connect(("localhost", port))
with context.wrap_socket(sock, server_hostname=socket.getfqdn()) as ssock:
ssock.connect(("127.0.0.1", port))
ssock.sendall(cmd.encode())
return ssock.makefile().read(-1)
else:
sock.connect(("localhost", port))
sock.connect(("127.0.0.1", port))
sock.sendall(cmd.encode())
return sock.makefile().read(-1)

Expand Down

0 comments on commit 5094481

Please sign in to comment.