📃 Certificates: Quick Setup


#1

I’m trying to use mitmproxy in a Rails 4.2.8 application, and was able to brew install mitmproxy successfully! :tada:

However, following the Certificates: Quick Setup, I’ve hit a brick wall. I’m assuming that the just start mitmproxy directive means to run the mitmproxy command in the Terminal application. If so, I have successfully done that and see “Flows”, “[0/0]” and “[*:8080]”.

How do I now: “configure your target device with the correct proxy settings”? Am I supposed to configure these settings on my Mac, in my browser, or in my Rails application? What should these settings be? Does anyone have an example they can share?

p.s. the Mac OS X link has been archived and is no longer updated by Apple. Maybe this link is a suitable replacement: https://support.apple.com/kb/PH20129?locale=en_US


#2

Hi,

Thanks for the heads-up regarding the Mac link - we’ll get that fixed. What exactly are you trying to achieve? View all requests hitting your Rails application, or see all HTTP requests made by your rails application?


#3

I’m trying to write feature specs for my application using Authorize.Net’s Accept.js, which accepts credit card information for transactions. I think I need to see the HTTP requests and responses so that I can effectively mock/stub in my tests. Am I on the right path using mitmproxy?


#4

In case anyone else comes across this, here are the steps I used to successfully get the proxy working for Mac + iOS. The docs really need to be updated from the current “installation left as an exercise for the reader”…

  1. Connect Mac and iPhone on the same Wi-Fi network.

  2. Mac: install https://docs.mitmproxy.org/stable/overview-installation/#macos.

  3. Mac: configure https://docs.mitmproxy.org/stable/howto-transparent/#macos (note have to sudo vim /etc/sudoers and use :w!).

  4. Mac: get IP Address by option-clicking on wifi in menu bar (eg 10.112.105.76).

  5. Mac > Terminal: run mitmproxy and get PORT from bottom right (eg [*:8080]).

  6. iPhone > Settings > Wifi > tap active Wi-Fi’s (i) symbol > Configure Proxy > Manual, server = 10.112.105.76, Port = 8080 > Save.

  7. iPhone > Safari: go to mitm.it and install the certificate.

  8. iPhone > Settings > General > About > Certificate Trust Settings > turn “Enable Full Trust For Root Certificates” ON for mitmproxy.

P.S. there are much simpler ways of testing web app requests than using mitmproxy…