Skip to content

Instantly share code, notes, and snippets.

@pspill
Last active May 11, 2023 14:26
Show Gist options
  • Save pspill/2f5300b86165d1f4edc732fbca8356fb to your computer and use it in GitHub Desktop.
Save pspill/2f5300b86165d1f4edc732fbca8356fb to your computer and use it in GitHub Desktop.
How do I capture Maven's HTTP traffic through Fiddler?
  1. In your Maven settings.xml file located at \conf, add the following XML snippet under the tag. 8888 is the port Fiddler listens to, which can be located in Fiddler under Tools | Options | Connections > in the textbox labeled "Fiddler listens on port".
<proxy>
  <id>Fiddler</id>
  <active>true</active>
  <protocol>https</protocol>
  <host>127.0.0.1</host>
  <port>8888</port>
</proxy>
  1. Export Fiddler's Root Certificate to your desktop: Tools | Options | HTTPS > Click the Actions button > Click Export Root Certificate to Desktop.
  2. Create truststore file from Fiddler Root Certificate by running the following command from an admin command prompt. You can type any value for the -storepass parameter below.
<JDK-Directory>\bin\keytool.exe -importcert -alias fiddler -file <Fiddler-Root-Certificate-File-Path> -keystore <Trust-Store-File-Path> -storepass <Trust-Store-Password>
  1. Configure Maven to use the truststore file you generated by setting the MAVEN_OPTS environment variable as follows:
set MAVEN_OPTS=-Djavax.net.ssl.trustStore=<Trust-Store-File-Path> -Djavax.net.ssl.trustStorePassword=<Trust-Store-Password>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment