Skip to content

Commit 311dabf

Browse files
committed
Fix NameErrors.
1 parent 18ff0cb commit 311dabf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Tools/scripts/get-remote-certificate.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import re
1010
import os
11-
import ssl
1211
import sys
1312
import tempfile
1413

@@ -38,7 +37,8 @@ def strip_to_x509_cert(certfile_contents, outfile=None):
3837
status, output = subproc(r'openssl x509 -in "%s" -out "%s"' %
3938
(tn, tn2))
4039
if status != 0:
41-
raise OperationError(status, tsig, output)
40+
raise RuntimeError('OpenSSL x509 failed with status %s and '
41+
'output: %r' % (status, output))
4242
fp = open(tn2, 'rb')
4343
data = fp.read()
4444
fp.close()
@@ -63,7 +63,8 @@ def strip_to_x509_cert(certfile_contents, outfile=None):
6363
'openssl s_client -connect "%s:%s" -showcerts < /dev/null' %
6464
(host, port))
6565
if status != 0:
66-
raise OSError(status)
66+
raise RuntimeError('OpenSSL connect failed with status %s and '
67+
'output: %r' % (status, output))
6768
certtext = strip_to_x509_cert(output)
6869
if not certtext:
6970
raise ValueError("Invalid response received from server at %s:%s" %

0 commit comments

Comments
 (0)