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/getcn | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test/tools/getcn') diff --git a/test/tools/getcn b/test/tools/getcn index 4cc028ca..212977c3 100755 --- a/test/tools/getcn +++ b/test/tools/getcn @@ -1,10 +1,14 @@ #!/usr/bin/env python - import sys -sys.path.insert(0, "../..") -from libmproxy import utils +sys.path.insert(0, "../../") +from libmproxy import certutils + +if len(sys.argv) > 2: + port = int(sys.argv[2]) +else: + pport = 443 -cn, san = utils.get_remote_cn(sys.argv[1], 443) +cn, san = certutils.get_remote_cn(sys.argv[1], port) print cn if san: for i in san: -- cgit v1.2.3