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

Commit

Permalink
Merge pull request #131 from iliul/master
Browse files Browse the repository at this point in the history
增加各Python版本的ssl模块兼容性判断
  • Loading branch information
0x5e committed Apr 7, 2016
2 parents 4ce83a5 + 21d5dc9 commit 77955db
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 77955db

Please sign in to comment.