summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/certtools.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/certtools.py b/tools/certtools.py
index da5021a..498a2e0 100644
--- a/tools/certtools.py
+++ b/tools/certtools.py
@@ -90,8 +90,8 @@ def get_root_cert(issuer):
def urlopen(url, data=None):
try:
- opener = urllib2.build_opener(urllib2.HTTPSHandler(context=None))
- except TypeError:
+ opener = urllib2.build_opener(urllib2.HTTPSHandler(context=ssl.SSLContext(ssl.PROTOCOL_TLSv1)))
+ except AttributeError:
opener = urllib2.build_opener(urllib2.HTTPSHandler())
return opener.open(url, data)
@@ -239,8 +239,8 @@ def check_auth_header(authheader, expected_key, publickeydir, data, path):
def http_request(url, data=None, key=None, verifynode=None, publickeydir="."):
try:
- opener = urllib2.build_opener(urllib2.HTTPSHandler(context=None))
- except TypeError:
+ opener = urllib2.build_opener(urllib2.HTTPSHandler(context=ssl.SSLContext(ssl.PROTOCOL_TLSv1)))
+ except AttributeError:
opener = urllib2.build_opener(urllib2.HTTPSHandler())
(keyname, keyfile) = key