I want to track down which part of an app contacts a given domain listed in its App Privacy Report.
Following the instructions given here I am able to capture a packet trace, but traffic to the domain in question is encrypted using QUIC.
Is there a way to insert e.g. mitmproxy into the capture process in order to get hold of the SSLKEYLOGFILE so that I can decrypt the traffic?
I was able to get this working today:
-
On my Mac, running macOS 26.2, I downloaded the Mac version (
mitmproxy-12.2.1-macos-arm64.tar.gz). -
I unpacked it.
-
I moved it to the Applications folder.
-
And launched it (which opens a Terminal window).
-
It creates its CA (certificate authority) certificates in
~/.mitmproxy. I check that was all present:% ls -l ~/.mitmproxy total 48 -rw-r--r--@ 1 quinn staff 1172 13 Mar 12:05 mitmproxy-ca-cert.cer -rw-r--r--@ 1 quinn staff 1035 13 Mar 12:05 mitmproxy-ca-cert.p12 -rw-r--r--@ 1 quinn staff 1172 13 Mar 12:05 mitmproxy-ca-cert.pem -rw-------@ 1 quinn staff 2384 13 Mar 12:05 mitmproxy-ca.p12 -rw-------@ 1 quinn staff 2847 13 Mar 12:05 mitmproxy-ca.pem -rw-r--r--@ 1 quinn staff 770 13 Mar 12:05 mitmproxy-dhparam.pem -
On a victim device running 26.2…
IMPORTANT This process involves changing system-wide trust settings. Given that, it’s not appropriate for a device you actually care about.
-
I launched Safari and open a private browsing tab (this helps with subsequent steps).
-
In Settings > Wi-Fi > My Network > Configure Proxy, I selected Manual, and entered my Mac’s IP address and port 8080.
-
Back in Safari, I went to
http://mitm.it. -
I tapped iOS > Get “mitmproxy-ca-cert.pem” and agreed to the download.
-
In Settings > General > VPN & Device Management > mitmproxy, I ran through the install sequence.
-
In Settings > About > Certificate Trust Settings, I enabled the “mitmproxy” CA.
-
Back in Safari, I created a new tab and entered
https://mitmproxy.org. -
In Terminal on my Mac, I saw those requests being proxied.
Note If you press
z, you can clear the list of requests which makes it easier to see the new ones. -
Back in Safari, I hit the refresh button and watched the requests continue to be proxied.
Neat-o!
I hit one really weird gotcha during this exercise. In step 13 I originally tested with https://example.com. That failed with a 502 Bad Gateway error. I suspect this is some special case within mitmproxy, because it only seems to affect that site.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"