aboutsummaryrefslogtreecommitdiffstats
path: root/test/tools
diff options
context:
space:
mode:
Diffstat (limited to 'test/tools')
-rwxr-xr-xtest/tools/getcert9
-rwxr-xr-xtest/tools/getcn17
2 files changed, 26 insertions, 0 deletions
diff --git a/test/tools/getcert b/test/tools/getcert
new file mode 100755
index 00000000..6447ecc7
--- /dev/null
+++ b/test/tools/getcert
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+import sys
+sys.path.insert(0, "../..")
+import socket, tempfile, ssl, subprocess
+
+addr = socket.gethostbyname(sys.argv[1])
+print ssl.get_server_certificate((addr, 443))
+
+
diff --git a/test/tools/getcn b/test/tools/getcn
new file mode 100755
index 00000000..212977c3
--- /dev/null
+++ b/test/tools/getcn
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+import sys
+sys.path.insert(0, "../../")
+from libmproxy import certutils
+
+if len(sys.argv) > 2:
+ port = int(sys.argv[2])
+else:
+ pport = 443
+
+cn, san = certutils.get_remote_cn(sys.argv[1], port)
+print cn
+if san:
+ for i in san:
+ print "\t", i
+
+