Python
- 1.
- 2.Save the script to ~/desktop file with the name is
script.py
- Add Certificate:
$ python3 script.py add
- Remove Certificate
$ python3 script.py remove
For macOS 12.2 or later, make sure you use
python3
By default, Python on macOS doesn't trust Proxyman self-signed certificates. As a result, you might encounter SSL Error if you try to intercept HTTPS traffic.
If you would like to intercept HTTPS Traffic from your Python script, you have to explicitly tell Python to use the Proxyman Root Certificate at
~/.proxyman/proxyman-ca.pem
Please follow the guideline:
- 1.Install Proxyman Certificate on Mac (If you've done it, please skip it. If not, please check out MacOS Guideline).
- 2.Run the following CLI on your Terminal app
$ export SSL_CERT_FILE=~/.proxyman/proxyman-ca.pem
$ export REQUESTS_CA_BUNDLE=~/.proxyman/proxyman-ca.pem
$ echo "export REQUESTS_CA_BUNDLE=~/.proxyman/proxyman-ca.pem" >> ~/.bash_profile ; source ~/.bash_profile
3. Done.
If you don't use Proxyman, please revert the change by commenting out:
# export REQUESTS_CA_BUNDLE=~/.proxyman/proxyman-ca.pem
in ~/.bash_profile
Solution: You have to explicitly tell python to use HTTP Proxy at IP=127.0.0.1 port = 9090.
You can find a solution by googling:
macos python set http proxy
Solution: You have to tell Python to trust the Proxyman Certificate at
~/.proxyman/proxyman-ca.pem
You can find a solution by googling:
macos python trust self signed certificate
Last modified 4mo ago