Mitmproxy Detail feature for mitmdump

Hey guys, do you have any idea how one would get the details the mitmproxy offers but for mitmdump? so for example

I’ve browsed the api but no joy. Would be nice to print out the Server Certificate details using the scripting feature .

Hi,

Take a look at https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/tools/console/flowdetailview.py#L16. :smiley:

Thanks @mhils, So I have implemented this.

import urwid

from mitmproxy import http
from mitmproxy.tools.console import common, searchable
from mitmproxy.utils import human
from mitmproxy.utils import strutils
from mitmproxy.tools.console import flowdetailview
def response(flow: http.HTTPFlow):
print(“repsonse”)

text = flowdetailview.flowdetails(None, flow)

print(text)

How exactly does ‘Searchable’ Work? Could you help?

I’ve looked at the API but I don’t know which method to choose or what ‘keyword’ to search for

Something like this?

print(text.get_text(“Address”))

You don’t want to just call flowdetails, I was rather pointing you to the implementation of that screen so that you see the parts that generate the output, e.g. flow.server_conn.cert.issuer.