summaryrefslogtreecommitdiffstats
path: root/Tools/scripts
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-12-30 17:36:17 (GMT)
committerGeorg Brandl <georg@python.org>2010-12-30 17:36:17 (GMT)
commit30baf2b0eda97fa8a36fddc81824b5772d764018 (patch)
treee7acf64c8be615c534231fe9092b165f012bbbec /Tools/scripts
parent5684a9ac30c09bf78f15be16864be7f1147cc2bb (diff)
downloadcpython-30baf2b0eda97fa8a36fddc81824b5772d764018.zip
cpython-30baf2b0eda97fa8a36fddc81824b5772d764018.tar.gz
cpython-30baf2b0eda97fa8a36fddc81824b5772d764018.tar.bz2
Fix NameErrors.
Diffstat (limited to 'Tools/scripts')
-rw-r--r--Tools/scripts/get-remote-certificate.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Tools/scripts/get-remote-certificate.py b/Tools/scripts/get-remote-certificate.py
index 02f1c8a..5811f20 100644
--- a/Tools/scripts/get-remote-certificate.py
+++ b/Tools/scripts/get-remote-certificate.py
@@ -8,7 +8,6 @@
import re
import os
-import ssl
import sys
import tempfile
@@ -38,7 +37,8 @@ def fetch_server_certificate (host, port):
status, output = subproc(r'openssl x509 -in "%s" -out "%s"' %
(tn, tn2))
if status != 0:
- raise OperationError(status, tsig, output)
+ raise RuntimeError('OpenSSL x509 failed with status %s and '
+ 'output: %r' % (status, output))
fp = open(tn2, 'rb')
data = fp.read()
fp.close()
@@ -63,7 +63,8 @@ def fetch_server_certificate (host, port):
'openssl s_client -connect "%s:%s" -showcerts < /dev/null' %
(host, port))
if status != 0:
- raise OSError(status)
+ raise RuntimeError('OpenSSL connect failed with status %s and '
+ 'output: %r' % (status, output))
certtext = strip_to_x509_cert(output)
if not certtext:
raise ValueError("Invalid response received from server at %s:%s" %