slrslr 2023-07-25 14:59:56 +00:00 committed by GitHub
parent 290025958f
commit cf2207f8ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]: