Maven:如何通过Fiddler抓取HTTPS流量

Maven: How to capture HTTPS traffic through Fiddler

挑战: 捕获对包存储库的 Maven 请求

问题:

Settings.xml在.m2文件夹下需要配置proxy against fiddler

<proxies>
    <proxy>
        <id>http</id>
        <active>true</active>
        <protocol>http</protocol>
        <username/>
        <password/>
        <host>localhost</host>
        <port>8888</port>
    </proxy>
    <proxy>
        <id>https</id>
        <active>true</active>
        <protocol>https</protocol>
        <username/>
        <password/>
        <host>localhost</host>
        <port>8888</port>
    </proxy>
</proxies>

Fiddler证书需要导出并添加到JAVA_HOME($JAVA_HOME\jre\lib\security).

中的jssecacerts

您使用工具创建 fiddler 证书 --> 选项 -> https --> 操作 --> 将根证书导出到桌面

命令到运行(必须根据JAVA_HOME路径更改):

"C:\Program Files\Java\jdk-11.0.1\bin\keytool" -importcert -file "<Your path to Fiddler certificate>\fiddler root.cert" -keystore "C:\Program Files\Java\jdk-11.0.1\lib\security\jssecacerts" -storepass changeit