How to capture HTTP(S) traffic from and to a Java web application with Fiddler2 or similar tool?

Infeligo picture Infeligo · May 29, 2011 · Viewed 13k times · Source

I want to capture data that my web application sends and receives from a CAS server via HTTPS. I tried using Fiddler2, but couldn't make it capture traffic from Java web application. It seems I need to configure it to use Fiddler2 as a proxy. How do I do it correctly?

Some additional info. I have already imported Fiddler's certificate with keytool. Running web application on Tomcat 7. Using IntelliJ Idea.

Answer

Piskvor left the building picture Piskvor left the building · May 29, 2011

Run the JVM with these parameters:

-Dhttps.proxyHost=yourhostwithfiddler -Dhttps.proxyPort=8888

Alternately, you could set the Java default proxy through a GUI - see http://www.java.com/en/download/help/proxy_setup.xml