From 510f11146efb937250829918b13256a18e760056 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Sat, 14 Sep 2019 12:59:00 +0300 Subject: [PATCH] v3.4.6 --- app/funct.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/funct.py b/app/funct.py index e2de54da..ab525d02 100644 --- a/app/funct.py +++ b/app/funct.py @@ -514,19 +514,18 @@ def check_ver(): def check_new_version(): - import urllib.request + import requests import ssl import sql proxy = sql.get_setting('proxy') - context = ssl._create_unverified_context() if proxy: proxyDict = { "https" : proxy, "http" : proxy } - response = urllib.request.urlopen('https://haproxy-wi.org/update.py?last_ver=1', context=context, proxies=proxyDict) + response = requests.get('https://haproxy-wi.org/update.py?last_ver=1', verify=False, proxies=proxyDict) else: - response = urllib.request.urlopen('https://haproxy-wi.org/update.py?last_ver=1', context=context) + response = requests.get('https://haproxy-wi.org/update.py?last_ver=1', verify=False) - res = response.read().decode(encoding='UTF-8') + res = response.content().decode(encoding='UTF-8') return res \ No newline at end of file