A note on how to install mitmproxy (man-in-the-middle proxy) on Mac OS X.
The target environment is as follows. This time, Python uses the system standard one. In addition, Xcode Command Line Tools are required separately.
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.10.1
BuildVersion: 14B25
$ uname -a
14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
$ python -V
Python 2.7.6
Install pip, Python's package management system. This time, install it under the user's home directory.
$ wget https://bootstrap.pypa.io/get-pip.py
$ python get-pip.py --user
...
Installing collected packages: pip
Then install mitmproxy. I installed pip under my home directory, so I need to put it in my PATH.
$ PATH=$PATH:~/Library/Python/2.7/bin
$ pip --version
pip 6.0.6 from /Users/USERNAME/Library/Python/2.7/lib/python/site-packages (python 2.7)
$ pip install --user mitmproxy
You can check the version with the --version
option of the mitmproxy
command.
$ mitmproxy --version
mitmproxy 0.11.3
If the error message "PyOpenSSL version is old" is displayed as shown below, you need to update PyOpenSSL.
$ mitmproxy --version
You are using an outdated version of pyOpenSSL: mitmproxy requires pyOpenSSL 0.14 or greater.
Your pyOpenSSL 0.13.1 installation is located at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL
$ sudo easy_install --upgrade PyOpenSSL
$ mitmproxy --version
mitmproxy 0.11.3
Recommended Posts