Mitmproxy missing GET requests


#1

Hey guys! I work with iOS apps testing and usually use Charles to mock json requests. However, now I’m trying to automate some of my tests, so I’m using Mitmproxy to write some python scripts and mock the json requests based on the request URL. But for my surprise, my request URL do not appear on the mitmproxy log. My IP is not v6 and I generated the needed pem file to access my url request. I copied my pem file to the root folder of mitmproxy, but I still can’t see my GET request on mitmproxy, even though it shows properly on Charles.

Command used: mitmweb --client-certs ~/.mitmproxy/ --port 6666

Sorry if I missed any info, I’m new in the community, if any other info is needed, please let me know.


#2

Hi Felyppe,

It does not really become clear to me what your issue is. You don’t see any requests in mitmproxy in general?


#3

mhils thanks for your reply. I set my client certificates but command line, but the request that needs them do not complete the handshake. In addition, several other domains do not complete the handshake either. When I use the same certificate in Charles, the request completes with 200 code response.


#4

I was able to handle the issue creating a folder named “ca” on the mitmproxy root folder and renaming my client certificate as “mitmproxy-ca.pem”. After that, I set the cadir to the “ca” folder, so every time a certificate is required, my own certificate is considered as the root mitmproxy certificate and used. I actually do not believe this is the correct approach, since I might want to use multiple client certificates, but for now it is handling the case.


#5

Thanks for looking into this. I think you are confusing the term “client certificate”. The error messages in your screenshot above show that your client does not trust mitmproxy’s server certificate. The client certificate is what the client would use itself to authenticate itself to the server. You can pass both custom client and normal/server certificates to mitmproxy: http://docs.mitmproxy.org/en/stable/certinstall.html


#6

Probably I misunderstood the logic behind it. The problem was that I tried this approach:

>>> mitmproxy --cert *.example.com=cert.pem

but it did not work with me, but changing the default mitmproxy certificate worked, don’t know why.