Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

Commit

Permalink
Additional check for #345
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMillerGIS committed Jun 8, 2017
1 parent c4236d4 commit ee6f65f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/arcrest/web/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ def _post(self, url,
if custom_handlers is None:
custom_handlers = []
if self._verify == False and \
sys.version_info[0:3] >= (2, 7, 9):
sys.version_info[0:3] >= (2, 7, 9) and \
hasattr(ssl,'create_default_context'):
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
Expand Down Expand Up @@ -461,7 +462,8 @@ def _post(self, url,
del k,v
hasContext = 'context' in self._has_context(request.urlopen)
if self._verify == False and \
sys.version_info[0:3] >= (2, 7, 9):
sys.version_info[0:3] >= (2, 7, 9) and \
hasattr(ssl,'create_default_context'):
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
Expand Down Expand Up @@ -594,7 +596,8 @@ def _get(self, url,
handlers.append(handler)
handlers.append(RedirectHandler())
if self._verify == False and \
sys.version_info[0:3] >= (2, 7, 9):
sys.version_info[0:3] >= (2, 7, 9) and \
hasattr(ssl,'create_default_context'):
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
Expand All @@ -616,7 +619,8 @@ def _get(self, url,
hasContext = False
if self._verify == False and \
'context' in self._has_context(request.urlopen) and \
sys.version_info[0:3] >= (2, 7, 9):
sys.version_info[0:3] >= (2, 7, 9) and \
hasattr(ssl,'create_default_context'):
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
Expand Down

0 comments on commit ee6f65f

Please sign in to comment.