From 21d5dc9b2e720b14aabb4db58330e069b7fe6d6a Mon Sep 17 00:00:00 2001 From: iliul Date: Thu, 7 Apr 2016 16:57:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=84Python=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E7=9A=84ssl=E6=A8=A1=E5=9D=97=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=80=A7=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wdf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wdf.py b/wdf.py index 3aa28b3..9f2e678 100755 --- a/wdf.py +++ b/wdf.py @@ -438,8 +438,10 @@ def heartBeatLoop(): def main(): global myRequests + + if hasattr(ssl, '_create_unverified_context'): + ssl._create_default_https_context = ssl._create_unverified_context - ssl._create_default_https_context = ssl._create_unverified_context headers = {'User-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36'} myRequests = requests.Session() myRequests.headers.update(headers)