Skip to content

Commit

Permalink
fix default ssl version to be secure
Browse files Browse the repository at this point in the history
  • Loading branch information
caryoscelus committed Sep 19, 2022
1 parent 494f9b9 commit 8132457
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ def httpRequest(url, as_file=False):

conn = http.client.HTTPSConnection(host)
sock = socket.create_connection((conn.host, conn.port), conn.timeout, conn.source_address)
conn.sock = ssl.wrap_socket(sock, conn.key_file, conn.cert_file)

context = ssl.create_default_context()
context.minimum_version = ssl.TLSVersion.TLSv1_2

conn.sock = context.wrap_socket(sock, conn.key_file, conn.cert_file)
conn.request("GET", request)
response = conn.getresponse()
if response.status in [301, 302, 303, 307, 308]:
Expand Down

0 comments on commit 8132457

Please sign in to comment.