From 533f61f67aab38f5bce882ad0dc03b7b5f292956 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 1 Mar 2012 21:08:44 +1300 Subject: Use PyOpenSSL and PyASN1 for certificate parsing. Yes, these are two more major dependencies for mitmproxy, but if we're going to do all the cool things I want to do with SSL certs, there is no other way. --- test/tools/getcert | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'test/tools/getcert') diff --git a/test/tools/getcert b/test/tools/getcert index dc655958..6447ecc7 100755 --- a/test/tools/getcert +++ b/test/tools/getcert @@ -4,21 +4,6 @@ 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 +print ssl.get_server_certificate((addr, 443)) -- cgit v1.2.3