Skip to content

Commit

Permalink
Set server_hostname automatically when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
shafemtol authored and aaugustin committed Mar 29, 2023
1 parent 399db68 commit 45f3b60
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/websockets/legacy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ def __init__(
else:
# If sock is given, host and port shouldn't be specified.
host, port = None, None
if kwargs.get("ssl"):
kwargs.setdefault("server_hostname", wsuri.host)
# If host and port are given, override values from the URI.
host = kwargs.pop("host", host)
port = kwargs.pop("port", port)
Expand Down

0 comments on commit 45f3b60

Please sign in to comment.