Skip to content
This repository has been archived by the owner on Jul 18, 2021. It is now read-only.

增加各Python版本的ssl模块兼容性判断 #131

Merged
merged 1 commit into from
Apr 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion wdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down