summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-07-09 18:05:05 -0400
committerrsiddharth <s@ricketyspace.net>2019-07-09 18:05:05 -0400
commit1d99bd991e7d5222889de6fa2051a897072e7ced (patch)
tree481c69f64e757db11e5c3499dceb96416c24d71e
parent38dda5656e0c9a41430571834b6f8c72bef4a0bb (diff)
revoke_crt.py: Use HTTPError from urllib.error.
-rw-r--r--revoke_crt.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/revoke_crt.py b/revoke_crt.py
index 6a95cfb..c2a1d63 100644
--- a/revoke_crt.py
+++ b/revoke_crt.py
@@ -3,6 +3,7 @@ import argparse, subprocess, json, os, urllib.request, sys, base64, binascii, co
tempfile, re
from urllib.request import urlopen
+from urllib.error import HTTPError
def revoke_crt(pubkey, crt):
"""Use the ACME protocol to revoke an ssl certificate signed by a
@@ -96,7 +97,7 @@ openssl dgst -sha256 -sign user.key -out {0} {1}
try:
resp = urlopen("{0}/acme/revoke-cert".format(CA), crt_data.encode())
signed_der = resp.read()
- except urllib2.HTTPError as e:
+ except HTTPError as e:
sys.stderr.write("Error: crt_data:\n")
sys.stderr.write(crt_data)
sys.stderr.write("\n")