Skip to content

Commit ffdbf29

Browse files
chivacanewsin
authored andcommitted
fix: ssl wrap_socket use for geolitedb
1 parent 34b4af4 commit ffdbf29

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/util/helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ def httpRequest(url, as_file=False):
209209

210210
conn = http.client.HTTPSConnection(host)
211211
sock = socket.create_connection((conn.host, conn.port), conn.timeout, conn.source_address)
212-
conn.sock = ssl.wrap_socket(sock, conn.key_file, conn.cert_file)
212+
context = ssl.create_default_context()
213+
conn.sock = context.wrap_socket(sock, server_hostname=conn.host)
213214
conn.request("GET", request)
214215
response = conn.getresponse()
215216
if response.status in [301, 302, 303, 307, 308]:

0 commit comments

Comments
 (0)