### Verify Charles Certificate Installation in Java cacerts with keytool Source: https://www.charlesproxy.com/documentation/using-charles/ssl-certificates Lists the entries in the Java cacerts keystore to confirm that the Charles certificate was successfully imported. Use the default keystore password "changeit" unless it has been changed. This command works on any platform with the Java keytool available. ```Shell keytool -list -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit ``` -------------------------------- ### Install Charles Proxy 5 Beta (Shell) Source: https://www.charlesproxy.com/documentation/installation/yum-repository This command installs the beta version of Charles Proxy 5. It uses the same YUM repository configuration as the stable version. ```shell sudo yum install charles-proxy5-beta ``` -------------------------------- ### Install Charles Proxy 5 (Shell) Source: https://www.charlesproxy.com/documentation/installation/yum-repository This command installs Charles Proxy version 5 using the previously configured YUM repository. It requires sudo privileges and installs a 'charles' command and adds Charles to application menus. ```shell sudo yum install charles-proxy5 ``` -------------------------------- ### Install Charles Proxy 3 (Shell) Source: https://www.charlesproxy.com/documentation/installation/yum-repository This command installs Charles Proxy version 3 using the YUM package manager. It can be installed alongside other versions of Charles Proxy. ```shell sudo yum install charles-proxy3 ``` -------------------------------- ### Import Charles Root Certificate into Java cacerts usingtool Source: https://www.charlesproxy.com/documentation/using-charles/ssl-certificates Uses the keytool utility to import the Charles SSL proxy certificate into the Java cacerts truststore. Run the command with appropriate privileges (sudo on Linux/macOS or as Administrator on Windows). Adjust the keystore path if your Java installation uses a different location. ```Shell sudo keytool -import -alias charles -file ~/Desktop/charles-ssl-proxying-certificate.pem -keystore JAVA_HOME/jre/lib/security/cacerts -storepass changeit ``` -------------------------------- ### Configure Charles Proxy YUM Repository (Shell) Source: https://www.charlesproxy.com/documentation/installation/yum-repository This snippet demonstrates how to create a YUM repository configuration file for Charles Proxy. It specifies the repository name, base URL, and GPG key URL, enabling the installation of Charles Proxy packages using YUM. ```shell cat < /etc/yum.repos.d/Charles.repo [charlesproxy] name=Charles Proxy Repository baseurl=https://www.charlesproxy.com/packages/yum gpgkey=https://www.charlesproxy.com/packages/yum/PublicKey EOF ``` -------------------------------- ### Install Charles Proxy 4 (Shell) Source: https://www.charlesproxy.com/documentation/installation/yum-repository This command installs Charles Proxy version 4 using the YUM package manager. It can be installed alongside other versions of Charles Proxy. ```shell sudo yum install charles-proxy ``` -------------------------------- ### Configure Java Application Proxy Source: https://www.charlesproxy.com/documentation/configuration/browser-and-system-configuration Demonstrates how to set HTTP and HTTPS proxy settings in a Java application using System.setProperty. This approach can also be used as command-line arguments to the Java executable. ```Java System.setProperty("http.proxyHost", "127.0.0.1"); System.setProperty("http.proxyPort", "8888"); System.setProperty("https.proxyHost", "127.0.0.1"); System.setProperty("https.proxyPort", "8888"); ``` -------------------------------- ### Android Application Proxy Configuration Source: https://www.charlesproxy.com/documentation/configuration/browser-and-system-configuration Demonstrates how to configure an Android application to use Charles Proxy, showing two different methods using HttpHost and HttpUrlConnection. ```Java HttpHost httpproxy = new HttpHost("192.168.0.101", 8888, "http"); httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,httpproxy); ``` ```Java HttpUrlConnection conn = url.openConnection(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("192.168.0.101", 8888))); ```