Skip to content

Commit

Permalink
Refactor test to use IP address instead of hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
jptomoya committed Nov 10, 2024
1 parent 5753ec1 commit 130b1c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/connection/test_sock.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def test_tls(self):
sock.close()

# connect with a specific SNI value
sock = Socket(host, 443, ssl=True, sni="example.com")
ip_addr = gethostbyname(host)
sock = Socket(ip_addr, 443, ssl=True, sni="example.com")
sock.sendline(f'GET {path} HTTP/1.1'.encode() + b'\r')
sock.send(f'Host: {host}'.encode() + b'\r\n')
sock.send(b'Connection: close\r\n\r\n')
Expand Down

0 comments on commit 130b1c6

Please sign in to comment.