summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Roesler <diafygi@gmail.com>2015-06-10 18:17:29 -0700
committerDaniel Roesler <diafygi@gmail.com>2015-06-10 18:17:29 -0700
commit89c2ce1fb90882634815ee6c840bd1804e19e36c (patch)
treecc31dc481ac61169f3755efc145fc5fc15cca750
parentf496e5d45ff9e953d0b1421611b4864e40e2530f (diff)
added error catching for non-issued cert
-rw-r--r--README.md2
-rw-r--r--sign_csr.py14
2 files changed, 10 insertions, 6 deletions
diff --git a/README.md b/README.md
index 19f9d44..46bf376 100644
--- a/README.md
+++ b/README.md
@@ -91,7 +91,7 @@ Prerequisites:
Example: Generate a key, create a csr, and have it signed.
--------------
$ openssl genrsa -out priv.key 4096
-$ openssl req -new -subj "/CN=example.com" -key priv.key -out cert.csr
+$ openssl req -new -subj "/CN=test4.byofs.com" -key priv.key -out cert.csr
$ python sign_csr.py cert.csr > signed.crt
--------------
diff --git a/sign_csr.py b/sign_csr.py
index ccf102e..2e79dea 100644
--- a/sign_csr.py
+++ b/sign_csr.py
@@ -204,11 +204,15 @@ TODO: apache and nginx configs showing how to do this.
#Step 10: Get the certificate signed
sys.stderr.write("Requesting signature...")
csr_data = "{}.{}.{}".format(header64, csr_b64, csr_sig64)
- print "csr_data", csr_data
- resp = urllib2.urlopen("{}/new-cert".format(CA), csr_data)
- result = json.loads(resp.read())
-
- return crt_pem
+ try:
+ resp = urllib2.urlopen("{}/new-cert".format(CA), csr_data)
+ result = json.loads(resp.read())
+ print "result", result
+ except Exception as e:
+ print "e", e
+ print "e.read()", e.read()
+
+ return "TODO"
if __name__ == "__main__":