summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2015-06-10 16:15:18 +0200
committerMagnus Ahltorp <map@kth.se>2015-06-10 17:09:45 +0200
commitd1fca4e2072984045cbe736dade59eeb5b8a0b2e (patch)
treeb23b03f29cb909ea10b77fe4ca2f602fe64ad37d
parent094c1e64a0ec84a5487828d3145dbc7e674f0f23 (diff)
Removed python 2.6 SSL workaround
On certain errors from the web server, the workaround was called even though 2.7 was used. The workaround doesn't parse URL:s correctly.
-rw-r--r--tools/certtools.py24
1 files changed, 5 insertions, 19 deletions
diff --git a/tools/certtools.py b/tools/certtools.py
index 7796a2c..ed8ab30 100644
--- a/tools/certtools.py
+++ b/tools/certtools.py
@@ -136,22 +136,15 @@ def pyopenssl_https_get(url):
return response_lines[len(response_lines) - 1]
def get_sth(baseurl):
- try:
- result = urlopen(baseurl + "ct/v1/get-sth").read()
- except urllib2.URLError:
- result = pyopenssl_https_get(baseurl + "ct/v1/get-sth")
+ result = urlopen(baseurl + "ct/v1/get-sth").read()
return json.loads(result)
def get_proof_by_hash(baseurl, hash, tree_size):
try:
params = urllib.urlencode({"hash":base64.b64encode(hash),
"tree_size":tree_size})
- try:
- result = \
- urlopen(baseurl + "ct/v1/get-proof-by-hash?" + params).read()
- except urllib2.URLError:
- result = \
- pyopenssl_https_get(baseurl + "ct/v1/get-proof-by-hash?" + params)
+ result = \
+ urlopen(baseurl + "ct/v1/get-proof-by-hash?" + params).read()
return json.loads(result)
except urllib2.HTTPError, e:
print "ERROR:", e.read()
@@ -161,12 +154,8 @@ def get_consistency_proof(baseurl, tree_size1, tree_size2):
try:
params = urllib.urlencode({"first":tree_size1,
"second":tree_size2})
- try:
- result = \
- urlopen(baseurl + "ct/v1/get-sth-consistency?" + params).read()
- except urllib2.URLError:
- result = \
- pyopenssl_https_get(baseurl + "ct/v1/get-sth-consistency?" + params)
+ result = \
+ urlopen(baseurl + "ct/v1/get-sth-consistency?" + params).read()
return json.loads(result)["consistency"]
except urllib2.HTTPError, e:
print "ERROR:", e.read()
@@ -227,9 +216,6 @@ def get_entries(baseurl, start, end):
try:
result = urlopen(baseurl + "ct/v1/get-entries?" + params).read()
return json.loads(result)
- except urllib2.URLError:
- result = pyopenssl_https_get(baseurl + "ct/v1/get-entries?" + params)
- return json.loads(result)
except urllib2.HTTPError, e:
print "ERROR:", e.read()
sys.exit(1)