diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-04-02 16:19:00 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-04-02 16:21:23 +1200 |
commit | ab1d8fa3500f786528c5c6a3e2bba19cd96595d0 (patch) | |
tree | e50cb7be73f3a4425438825ff378bb94bf1a67d9 /libmproxy/flow.py | |
parent | bb03255da042f478d4fb1866b39028760e14f0bf (diff) | |
download | mitmproxy-ab1d8fa3500f786528c5c6a3e2bba19cd96595d0.tar.gz mitmproxy-ab1d8fa3500f786528c5c6a3e2bba19cd96595d0.tar.bz2 mitmproxy-ab1d8fa3500f786528c5c6a3e2bba19cd96595d0.zip |
Expand SSL cert support
- Capture the remote SSL certificate
- Expose the remote cert as an attribute on Response
- Expand the certutils.SSLCert interface to expose more cert info
Diffstat (limited to 'libmproxy/flow.py')
-rw-r--r-- | libmproxy/flow.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py index bb079a8d..6ffef6f2 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -566,11 +566,12 @@ class Response(HTTPMsg): content: Response content timestamp: Seconds since the epoch """ - def __init__(self, request, code, msg, headers, content, timestamp=None): + def __init__(self, request, code, msg, headers, content, peercert, timestamp=None): assert isinstance(headers, ODictCaseless) self.request = request self.code, self.msg = code, msg self.headers, self.content = headers, content + self.peercert = peercert self.timestamp = timestamp or utils.timestamp() controller.Msg.__init__(self) self.replay = False @@ -640,6 +641,7 @@ class Response(HTTPMsg): self.headers = ODictCaseless._from_state(state["headers"]) self.content = state["content"] self.timestamp = state["timestamp"] + self.peercert = state["peercert"] def _get_state(self): return dict( @@ -647,6 +649,7 @@ class Response(HTTPMsg): msg = self.msg, headers = self.headers._get_state(), timestamp = self.timestamp, + peercert = self.peercert, content = self.content ) @@ -658,6 +661,7 @@ class Response(HTTPMsg): str(state["msg"]), ODictCaseless._from_state(state["headers"]), state["content"], + state.get("peercert"), state["timestamp"], ) |