I use Charles Proxy on Mac OS, to debug mobile app: it works well on real devices (iOS/Android), on iOS simulator, but it's a little tricky on Android simulators (several IPs are used for the same URL).
However, I try to debug APIs Integrations Tests, and in this case, I don't see any trace in Charles Proxy...
I've tried to do this with Visual Studio for Mac and with Rider.
When I debug the test, I can see that the call is well done, but I don't see any trace in Charles Proxy, whereas when I use the same URL in the mobile app, I can see the trace easily.
Is there a specific step to do to include calls from console app or Integration Tests calls from any IDE? (Visual Studio for Mac or Rider)
In the same time, I can see all the traces coming from Chrome, Safari, Slack,... So I don't see what I could have forgotten.
After having edited the HttpClientHandler like this, I can see traces in Charles Proxy:
public class TestsHttpMessageHandlerFactory : IHttpMessageHandlerFactory
{
public HttpMessageHandler Create()
{
return new HttpClientHandler
{
Proxy = new WebProxy("http://192.168.86.177:8888"),
UseProxy = true
};
}
}
But now I have the following error details in Charles Proxy:
- Status: Failed Failure: Client closed the connection before a request
was made. Possibly the SSL certificate was rejected.
- Notes: You may need to configure your browser or application to trust the Charles Root Certificate. See SSL Proxying in the Help menu.
- Response Code: 200 Connection established
How to configure the certificate in my app?
Regards,