Skip to content

Latest commit

 

History

History
59 lines (36 loc) · 2.97 KB

java.md

File metadata and controls

59 lines (36 loc) · 2.97 KB
description Install the Proxyman Root CA certificate into all Java KeyStores on macOS with one script, so Proxyman can capture HTTPS traffic from Java and Kotlin apps.

Java VMs

To intercept HTTPS traffic from Java apps, you need extra steps to install the Proxyman CA Certificate into the Java KeyStore. For example, to:

  • Intercept traffic from unit tests (written in Java or Kotlin)
  • Intercept traffic from a Java app or CLI

1. Benefit

  • Proxyman provides a script that automatically installs the Root Certificate into the Java KeyStore with 1 click ✅
  • Supports $JAVA_HOME
  • Supports SDKMAN
  • Supports /usr/libexec/java_home

2. How to use?

1. Install Proxyman CA on your Mac

Before installing the Proxyman CA on Java VMs, you have to install it properly on your Mac.

Check out the macOS guide:

{% content-ref url="macos.md" %} macos.md {% endcontent-ref %}

You can skip this step if you've already done it.

2. Install Proxyman CA to all Java Key Stores

  • Certificate Menu -> Install Certificate on Java VMs -> Run Script...

Proxyman Certificate menu with Install Certificate on Java VMs open and Run Script highlighted

Run the Java certificate script

  • The script tries to find the KeyStore location from JAVA_HOME, SDKMAN, or $(/usr/libexec/java_home) and installs the CA Certificate if possible

Terminal output of the Proxyman Java script installing the certificate into the Java cacerts KeyStore

Proxyman installs the certificate into all Java trust stores it can find

{% hint style="info" %} You can find the script at /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Versions/A/Resources/install-certificates-java.sh {% endhint %}

{% hint style="info" %} The script might ask for Automation permission, because Proxyman uses AppleScript to run it in the Terminal app with admin permission. {% endhint %}

Alternative solution

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target