diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2013-01-20 22:37:43 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2013-01-20 22:37:43 +1300 |
commit | 9bd269c26a02d94f16d7c39f3cb0a4cd46bb40b1 (patch) | |
tree | e773b9c7a04038b810c0d5afc31cb1dc874eaeda /libpathod/pathod.py | |
parent | 369b55b0944acf55d62a70df5777ce05adfe711c (diff) | |
download | mitmproxy-9bd269c26a02d94f16d7c39f3cb0a4cd46bb40b1.tar.gz mitmproxy-9bd269c26a02d94f16d7c39f3cb0a4cd46bb40b1.tar.bz2 mitmproxy-9bd269c26a02d94f16d7c39f3cb0a4cd46bb40b1.zip |
Add support for client certificates
- pathod request logs now include a clientcert member with details on the
client cert, or None if there wasn't one.
- pathoc has a -C option to specify a client certificate
Diffstat (limited to 'libpathod/pathod.py')
-rw-r--r-- | libpathod/pathod.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libpathod/pathod.py b/libpathod/pathod.py index ce64acf9..ac56619b 100644 --- a/libpathod/pathod.py +++ b/libpathod/pathod.py @@ -96,6 +96,17 @@ class PathodHandler(tcp.BaseHandler): self.info(s) return False, dict(type = "error", msg = s) + clientcert = None + if self.clientcert: + clientcert = dict( + cn = self.clientcert.cn, + subject = self.clientcert.subject, + serial = self.clientcert.serial, + notbefore = self.clientcert.notbefore.isoformat(), + notafter = self.clientcert.notafter.isoformat(), + keyinfo = self.clientcert.keyinfo, + ) + request_log = dict( path = path, method = method, @@ -103,6 +114,7 @@ class PathodHandler(tcp.BaseHandler): httpversion = httpversion, sni = self.sni, remote_address = self.client_address, + clientcert = clientcert ) try: |