11

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.

Infeligo
  • 11,715
  • 8
  • 38
  • 50

3 Answers3

9

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

Piskvor left the building
  • 91,498
  • 46
  • 177
  • 222
  • Thanks for the GUI proxy setting tip, but I still could not capture any data from my web application. What should the value of "yourhostwithfiddler" be? A set it to localhost. – Infeligo Jun 03 '11 at 11:31
  • @Infeligo: Whatever host that runs an instance of Fiddler. If it's the same computer that runs your Java application, then `localhost` should work. – Piskvor left the building Jun 03 '11 at 11:33
4

In addition to Piskvor answer, make sure you configure Fiddler to capture the HTTPS traffic: Tools --> Fiddler Options --> HTTPS --> Capture HTTPS CONNECTs

Tarlog
  • 10,024
  • 2
  • 43
  • 67
  • 2
    Ah, good point. You may also want to *decrypt* them (by checking the next checkbox), but this will be more complicated (as Fiddler will essentially be a MITM proxy) – Piskvor left the building May 29 '11 at 14:27
  • Just in case someone wants to decrypt the https connection. http://ofcode.blogspot.com/2012/07/intercepting-https-traffic-for-java.html – Jazzepi Dec 22 '13 at 16:56
2

You can also use directly the settings screen: "File / Settings...", then choose"IDE Settings / HTTP Proxy". Then tick "Use proxy", "Host name": localhost, "Port number": 8888

Jean Lestang
  • 861
  • 9
  • 9