Skip to content
Mittelware
All posts

What is a man-in-the-middle proxy, and why developers use one

A plain explanation of how a debugging proxy reads encrypted HTTPS traffic, why it needs a certificate you trust, what it cannot see, and how to use one safely.

The Mittelware team 3 min read

"Man-in-the-middle" sounds like an attack, and when someone else does it to you it is one. A debugging proxy does the same thing on purpose, on your own computer, so you can see and change what your own apps send. This page explains how it works and what to watch for.

What a proxy does#

Normally an app talks directly to a server. With a proxy in between, the app talks to the proxy, and the proxy talks to the server. Both sides still get their answers. The proxy just gets to look at the conversation, write it down and, if you tell it to, change it.

A debugging proxy runs on your own machine. The traffic goes to 127.0.0.1 first, and out to the internet from there.

The HTTPS problem#

For plain HTTP, that is all there is to it. HTTPS is encrypted from the app to the server, so a proxy in the middle would only see scrambled bytes. To read it, the proxy has to do something clever:

  1. The app asks to connect to api.example.com over HTTPS.
  2. The proxy answers as if it were api.example.com, using a certificate it made up.
  3. The proxy opens its own HTTPS connection to the real server.
  4. Now it can decrypt traffic from the app, read or change it, then encrypt it again for the server, and back.

That is the "man in the middle", and step 2 is why your computer must trust the proxy's certificate authority first. Without that trust, every app would correctly refuse the made-up certificate.

Why trusting the certificate is safe, when you do it right#

A certificate authority you trust can vouch for any site, so it should be treated carefully. The things to check in any debugging proxy:

  • The key stays on your machine. It should never be uploaded or shared.
  • It is trusted for your user account only, not the whole computer.
  • You can remove it from your operating system's certificate store at any time.

Mittelware creates its own authority, named Mittelware CA, on your computer. It asks to trust it for the current user account only, the certificate and its key never leave the device, and you can choose Monitor HTTP Only instead if you do not want to decrypt anything.

What a proxy cannot see#

  • Apps that pin their certificate. They refuse any certificate that is not their own, so a proxy cannot decrypt them without extra setup.
  • Apps that ignore the system proxy. If an app does not use the operating system's proxy settings, its traffic never reaches the proxy.
  • Some local traffic. Browsers often skip the proxy for localhost.
  • Non-HTTP protocols. Raw TCP and UDP are out of scope for an HTTP proxy.

Mittelware has a bypass list for hosts that must be passed straight through, such as sign-in flows that break when decrypted.

What developers use it for#

  • Seeing the truth. What does the app really send? Which request is slow? What did the server reply?
  • Changing responses. Return an error or different data to test how the app copes. See simulating a 502.
  • Mocking. Answer a request that has no backend yet. See mocking an API before it exists.
  • Checking phones. Point a phone at the proxy and see what a mobile app sends. See what your phone is sending.

Using one safely#

Only inspect traffic from apps and devices you own or are allowed to test. Remove the certificate when you stop using a proxy tool, and never install someone else's authority on your machine.

Try it#

Download Mittelware, then follow how to inspect HTTPS traffic from any app.

Keep reading