šŸ“ƒ Certificates: Quick Setup

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

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?

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?

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ā€¦