I'm using ADAL(a 3rd party OAuth2.0 implementation). I'm trying to collect traces of the communication using Charles as a proxy. What I imagine is happening (not relying on anything):
- ADAL requests a certificate from the Authority through Charles
- Charles requests a certificate from the Authority and passes it to ADAL.
- ADAL wants to open an SSL channel with the Authority but actually opens it with Charles.
- Charles opens an SSL channel with the Authority and forwards any requests/responses to ADAL
However, ADAL rejects the Authority's certificate. Now as far as I know, certificates are passed unencrypted. So if I was correct in describing all the above steps, how does ADAL know that the entity he's talking to isn't infact the Authority he's supposed to be talking with?