how to Capture https with fiddler, in java

前端 未结 4 2032
春和景丽
春和景丽 2020-11-28 01:58

I am running the following java program in the Eclipse IDE:

import java.net.*;
import java.io.*;

public class HH
{
    public static void main(String[] arg         


        
4条回答
  •  不知归路
    2020-11-28 02:34

    Create a keystore containing the Fiddler certificate. Use this keystore as the truststore for the JVM along with the proxy settings.

    Here's how to do that:

    • Export Fiddler's root certificate

    Tools -> Fiddler Options... -> HTTPS -> Export Root Certificate to Desktop

    • Create a keystore with this certificate

    Open command line as administrator (keytool doesn't work otherwise)

    \bin\keytool.exe -import -file C:\Users\\Desktop\FiddlerRoot.cer -keystore FiddlerKeystore -alias Fiddler

    Enter a password when prompted. This should create a file called FiddlerKeystore.

    • Now start the JVM with Fiddler as the proxy and this keystore as the truststore. You'll need these vmargs:

    -DproxySet=true

    -DproxyHost=127.0.0.1

    -DproxyPort=8888

    -Djavax.net.ssl.trustStore=

    -Djavax.net.ssl.trustStorePassword=

    Use these vmargs in your eclipse run configuration and you should be good to go.

    I'm able to capture HTTPS requests made from the JVM without any issues with this setup.

提交回复
热议问题