From 813245718406ec3933532010af05a48bf5bcc5b6 Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Mon, 19 Sep 2022 20:03:16 +0000 Subject: [PATCH] fix default ssl version to be secure --- src/util/helper.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/helper.py b/src/util/helper.py index ac330fd8e..a0daa557f 100644 --- a/src/util/helper.py +++ b/src/util/helper.py @@ -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]: