I asked to myself: “Hey, how does Burp work with HTTPS and why do some apps break even after trusting the Burp cert?” and honestly, it messed me up.
I thought I understood HTTPS. I knew about SSL and certs in theory. But the moment I hit a real app doing SSL pinning, everything broke and I had no idea what was going on.
So I sat down and rewired my brain. This article is me, re-explaining everything I wish someone explained to me when I was just starting out.
After a successful TCP handshake, the TLS handshake begins. This is where encryption and identity verification take place before any real HTTP data (like a GET request) is exchanged.
Now how does it work:
The client or browser will send a ClientHello message to the server. The server responds with a ServerHello, along with its public key and certificate. The certificate is used to prove that the certificate belongs to a valid organization and is not some phishy attacker.
The browser validates the certificate by:
Internally, the browser uses the CA’s public key to decrypt the signature in the server’s cert and checks if it matches the expected value. If it does — the cert is trustworthy, and the TLS handshake finishes successfully.
Boom — now a secure tunnel is set up and real HTTP communication (like GET, POST) begins.
You can read more in depth about the actual communication here: https://tls12.xargs.org/
When you configure your browser to route traffic through Burp:
127.0.0.1:8080).example.com).example.com server and retrieves its SSL/TLS certificate.example.com, signed by Burp’s own internal Certificate Authority (CA).Now the browser does one of two things:
SEC_ERROR_UNKNOWN_ISSUER, TLS failsBurp essentially performs two TLS handshakes:
This is what makes interception possible.
SSL pinning is when an app doesn’t care what the OS/browser trusts. Instead, it hardcodes its own trust.
“I trust only this exact cert or public key — nothing else.”
Pinning protects apps against MITM attacks even if the user installs a malicious CA (like Burp’s). So even with Burp’s CA added, the app says:
“This cert isn’t what I was expecting. Connection refused.”
Types of pinning:
Where is it pinned?
CertificatePinner.add())network_security_config.xmlHere’s what a pinned app does when making an HTTPS request:
This breaks interception.
There are two main ways:
Hook the function that performs the pinning check and force it to always return true. There are a lot of scripts available online you can refer to.
This is more permanent but riskier — could break functionality.
logcat shows: Trust anchor not found, SSLHandshakeExceptionI will write a specific article on how to properly bypass SSL Pinning if needed.
That is it for this article thingy, Happy Hacking :)