Create a keystore containing the fiddler certificate and use it:
keytool -importcert -file " fiddlerroot.cer" -keystore " fiddler.jks" -alias "fiddler"
java -DproxySet=true -DproxyHost=127.0.0.1 -DproxyPort=8888 -Dhttps.proxyPort=8888 -Dhttps.proxyHost=127.0.0.1 -Djavax.net.ssl.trustStore=<path to FiddlerKeystore> -Djavax.net.ssl.trustStorePassword=<password> -jar test.jar
If you use third party HTTP libraries, you need to set the connection proxies. Example with Apache Commons HttpClient:
HttpClient httpClient = new HttpClient();
httpClient.getHostConfiguration().setProxy("localhost", 8888);
No comments:
Post a Comment