From 1d99bd991e7d5222889de6fa2051a897072e7ced Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Tue, 9 Jul 2019 18:05:05 -0400 Subject: revoke_crt.py: Use HTTPError from urllib.error. --- revoke_crt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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") -- cgit v1.2.3