3

I'm trying to view Http requests I sent using Fiddler. I am on windows 8. I've enabled loopback on all visible apps. However, I am running app command line. I am running main of java app, and it does not see this traffic. Everything sent from browser is logged. But nothing from my java app? whats up with that? This is just a simple app issuing http calls from java Main(). Thats it.

Well I followed steps here: how to Capture https with fiddler, in java

But on windows it can't seem to find the keystore. For one thing it generated without and name extension. So I copied to FiddlerKeystore.jks

-DproxySet=true

-DtrustAnchors=true

-DproxyHost=127.0.0.1

-DproxyPort=8888

-Djavax.net.ssl.trustStore=c:\txi\FiddlerKeystore.jks \ tried with both one and two slashes

-Djavax.net.ssl.trustStorePassword=Guest1432

Community
  • 1
  • 1
user3186731
  • 441
  • 2
  • 5
  • 10
  • 1
    Is your application making HTTP or HTTPS calls? If it is only HTTP, I would not think that you would need the keystore stuff. Just the proxy stuff. – matt forsythe Jan 13 '14 at 22:16

2 Answers2

2

The JVM does not necessarily read your system's HTTP proxy settings. You will need to set fiddler as your HTTP proxy manually.

Assuming that fiddler is listening on port 8000:

java -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8000 [yourjar]
Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
1

You can proxy the traffic with Eclipse if you want to. If you would like that, there are instructions here.

matt forsythe
  • 3,863
  • 1
  • 19
  • 29
  • No, it doesn't, it acts as an HTTP proxy. – Edward Thomson Jan 13 '14 at 21:35
  • @EdwardThomson Wow - totally didn't know that! I removed the part about it working via a DLL. I think where I've gotten into trouble with Fiddler in the past is in using Java apps that connect via a bare Socket... – matt forsythe Jan 13 '14 at 21:44
  • @mattforsythe What, exactly, makes a socket "bare"? In this case, obviously the problem would occur if the app used a HTTP implementation that doesn't support proxying, but that's not the same thing. – millimoose Jan 13 '14 at 21:47
  • @millimoose Using the Socket library instead of an HTTP library that does things like check for HTTP proxy settings. – matt forsythe Jan 13 '14 at 21:48
  • @mattforsythe yes, that makes sense, I understand now. And different apps could use different java HTTP libraries, all with their own ways of setting the proxies. It's very disappointing, really. – Edward Thomson Jan 13 '14 at 21:53
  • @mattforsythe Yeah, my point was more that every networking application has to use a "bare" socket at a low enough level, so it's not a very good way to phrase things. "Ignores proxy settings" or "doesn't support proxying" is more accurate. – millimoose Jan 13 '14 at 21:54
  • @EdwardThomson I think the information I received (a while ago) was that certain native apps use a DLL to set up the connection which automatically reads the proxy settings from the system. (The same ones that IE uses). Since Java apps don't use this DLL, then you need to use the system vars. For some reason, I must have forgotton that the underlying mechanism was actually a proxy. – matt forsythe Jan 13 '14 at 21:57
  • @mattforsythe Yeah, that's exactly right - `wininet.dll` if I recall. – Edward Thomson Jan 13 '14 at 22:37