Why does Charles give error code for SSL Proxy?

I have a local nginx proxy that is letting my local site work on https://fakedomain.com/endpoint. If I hit it in the browser, Charles shows the response properly.

Shows HTML

If I use the SSL Proxy such that hitting https://www.anotherdomain.com/endpoint points at https://fakedomain.com/endpoint, it gives a Response Code of -1 with a response preview that looks like this:

Bad response

I have SSL Proxying working fine, generally. If I proxy to a known https location, Charles proxy works fine.

Facebook to Yahoo

My local site/server uses a .crt and .key file that someone else generated, which I think may be the problem. I'm on a Mac, double clicked the .crt, and got it added to my keychain. I opened it up and set it to always trust:always trust

My guess is that Charles doesn't trust this cert when proxying, so it errors out. Just not sure how to fix this.

Leave Your Comment