diff options
Diffstat (limited to 'test/tools')
-rwxr-xr-x | test/tools/getcert | 24 | ||||
-rwxr-xr-x | test/tools/getcn | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/test/tools/getcert b/test/tools/getcert new file mode 100755 index 00000000..dc655958 --- /dev/null +++ b/test/tools/getcert @@ -0,0 +1,24 @@ +#!/usr/bin/env python +import sys +sys.path.insert(0, "../..") +import socket, tempfile, ssl, subprocess + +addr = socket.gethostbyname(sys.argv[1]) +s = ssl.get_server_certificate((addr, 443)) +f = tempfile.NamedTemporaryFile() +f.write(s) +f.flush() +p = subprocess.Popen( + [ + "openssl", + "x509", + "-in", f.name, + "-text", + "-noout" + ], + stdout = subprocess.PIPE +) +out, _ = p.communicate() +print out + + diff --git a/test/tools/getcn b/test/tools/getcn index d17ec0f6..4cc028ca 100755 --- a/test/tools/getcn +++ b/test/tools/getcn @@ -10,4 +10,4 @@ if san: for i in san: print "\t", i - + |