Skip to content

Commit

Permalink
Merge pull request #2944 from Kriechi/docs++
Browse files Browse the repository at this point in the history
readd Wireshark SSL master secrets docs
  • Loading branch information
cortesi committed Mar 2, 2018
2 parents 8ea58a4 + a074a1d commit 9760396
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/src/content/howto-wireshark-tls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "Wireshark and SSL/TLS"
menu:
howto:
weight: 1
---

# Wireshark and SSL/TLS Master Secrets

The SSL/SSL master keys can be logged by mitmproxy so that external programs can
decrypt SSL/TLS connections both from and to the proxy. Recent versions of
Wireshark can use these log files to decrypt packets. See the [Wireshark wiki](https://wiki.wireshark.org/SSL#Using_the_.28Pre.29-Master-Secret) for more information.

Key logging is enabled by setting the environment variable `SSLKEYLOGFILE` so
that it points to a writable text file:
{{< highlight bash >}}
SSLKEYLOGFILE="$PWD/.mitmproxy/sslkeylogfile.txt" mitmproxy
{{< / highlight >}}
You can also `export` this environment variable to make it persistent for all applications started from your current shell session.

You can specify the key file path in Wireshark via `Edit -> Preferences ->
Protocols -> SSL -> (Pre)-Master-Secret log filename`. If your SSLKEYLOGFILE
does not exist yet, just create an empty text file, so you can select it in
Wireshark (or run mitmproxy to create and collect master secrets).

Note that `SSLKEYLOGFILE` is respected by other programs as well, e.g., Firefox
and Chrome. If this creates any issues, you can use `MITMPROXY_SSLKEYLOGFILE`
instead without affecting other applications.

0 comments on commit 9760396

Please sign in to comment.