diff --git a/mitmproxy/tools/console/flowdetailview.py b/mitmproxy/tools/console/flowdetailview.py index 0844ac4d6..2fded00bf 100644 --- a/mitmproxy/tools/console/flowdetailview.py +++ b/mitmproxy/tools/console/flowdetailview.py @@ -55,8 +55,8 @@ def flowdetails(state, flow: mitmproxy.flow.Flow): common.format_keyvals(parts, indent=4) ) - c = sc.certificate_list[0] - if c: + if sc.certificate_list: + c = sc.certificate_list[0] text.append(urwid.Text([("head", "Server Certificate:")])) parts = [ ("Type", "%s, %s bits" % c.keyinfo), diff --git a/test/mitmproxy/data/dumpfile-7.bin b/test/mitmproxy/data/dumpfile-7.bin new file mode 100644 index 000000000..77243bfd9 Binary files /dev/null and b/test/mitmproxy/data/dumpfile-7.bin differ diff --git a/test/mitmproxy/tools/console/test_integration.py b/test/mitmproxy/tools/console/test_integration.py index 91ce25d3b..2bea2349a 100644 --- a/test/mitmproxy/tools/console/test_integration.py +++ b/test/mitmproxy/tools/console/test_integration.py @@ -40,5 +40,6 @@ def console(monkeypatch): def test_integration(tdata, console): - console.type(f":view.flows.load {tdata.path('mitmproxy/data/dumpfile-018.bin')}") + console.type(f":view.flows.load {tdata.path('mitmproxy/data/dumpfile-7.bin')}") console.type("") + console.type("") # view second flow