Devices and runtimes
Java and the JVM
Make Java, Gradle and Android Studio trust Cloak Proxy's certificate and send their traffic through it.
Java keeps its own list of trusted certificates and its own proxy settings, so the macOS proxy and keychain don’t reach it. The Java & JVM page of Device & Runtime Setup has both commands, filled in with your port and your certificate’s path, each with a Copy button.
The Java & JVM page.
Firefox, Docker, Flutter and Electron have their own pages now: Capturing browser and Electron apps, Docker and Flutter.
In the commands, the certificate path is written as $HOME/Library/Application Support/CloakProxy/cloak-proxy-ca.pem so you can paste it into a shell. The port is the one Cloak Proxy listens on (9090 by default).
Java (JVM, Gradle, Android Studio)
Section titled “Java (JVM, Gradle, Android Studio)”Java uses its own trust store, cacerts, and its own proxy settings.
-
Import the Cloak Proxy certificate into the JDK’s trust store. Copy the command from the Java (JVM, Gradle, Android Studio) section and run it:
Terminal sudo keytool -importcert -noprompt -alias cloak-proxy -cacerts -storepass changeit -file "$HOME/Library/Application Support/CloakProxy/cloak-proxy-ca.pem"changeitis the JDK’s default trust store password.-cacertsneeds Java 9 or later. -
Run your program with the proxy settings:
Terminal java -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=9090 -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=9090 -jar app.jar
keytool changes the JDK it belongs to. If you use more than one JDK (Android Studio bundles its own), run the keytool of each JDK that should trust the certificate. A JDK update can replace cacerts, so import again after updating.
To pass the proxy settings without editing a command line, set them in the environment or, for Gradle, in gradle.properties:
export JAVA_TOOL_OPTIONS="-Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=9090 -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=9090"systemProp.https.proxyHost=127.0.0.1systemProp.https.proxyPort=9090systemProp.http.proxyHost=127.0.0.1systemProp.http.proxyPort=9090Undo: remove the certificate and the proxy settings.
sudo keytool -delete -alias cloak-proxy -cacerts -storepass changeitFirefox
Section titled “Firefox”The easiest way is a capturing Firefox: its own profile, already proxied. To use your everyday Firefox instead, trust the certificate on this Mac (Settings › Certificate), then in about:config set security.enterprise_roots.enabled to true and turn on macOS capture. Firefox follows the macOS proxy by default.