question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to get mitmproxy working on Sierra

See original GitHub issue
Problem:

I have been trying to get mitmproxy to work on my macOS sierra and unable to do so.

What have you tried so far?
  • Installed using Hombrew: brew install mitmproxy.

  • By running mitmproxy on the terminal it starts the application.

  • As the docs suggest, I now have to install certificates:

    • Went to mitm.it. It shows: If you can see this, traffic is not passing through mitmproxy.
    • Googled if somebody else has this issue and followed the manual setup.
  • Removed ~./mitmproxy folder for a clean run. Restarted mitmproxy. The new cert’s are created.

  • Copied the entire folder ~./mitmproxy to the Keychain Access. For files with password entered nothing and continued. In the end Keychain Access gives me the results:

    An error has occurred. Unable to import an item. 
    The contents of this item cannot be retrieved.
    
  • Still I see an entry for mitmproxy certs in Keychain access with the following error with it:

     This root certificate is not trusted
    
  • Double clicking on the certificate -> Trust -> When using the certificate. Changed from Use System defaults to Always trust. The above error of not getting trusted get’s removed.

  • Restarted mitmproxy. No logs if I go to some website. mitm.it shows the same error.

  • Restarted Mac for reloading certs, that also didn’t solve the problem.

System information

Mitmproxy version: 2.0.2 (release version) Python version: 3.6.1 Platform: Darwin-16.5.0-x86_64-i386-64bit SSL version: OpenSSL 1.1.0e 16 Feb 2017 Mac version: 10.12.4 (‘’, ‘’, ‘’) x86_64

Thoughts

Read the documentation again more closely in case that I might have missed something. In the Quick Setup it’s mentioned

start mitmproxy and configure your target device with the correct proxy settings.

How does one configure my device with correct proxy settings?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Graystripe17commented, Jul 24, 2018

Another answer: I forgot to turn off my adblock VPN 😕

2reactions
mhilscommented, May 21, 2017

Thanks for the detailed report. While it’s easy to classify this as a layer 8 error, I think we should ultimately have better docs for this. Or - as Charles and Fiddler do it (I think) - capture the local machine by default.

refs https://github.com/mitmproxy/mitmproxy.org/issues/20

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running mitmproxy on macOS Sierra: traffic not passing through
Go to mitm.it from your device and download the MITM certificate. Name the certificate and okay it as a trusted certificate.
Read more >
Installation - mitmproxy docs
Please follow the steps for your operating system. # macOS. The recommended way to install mitmproxy on macOS is to use Homebrew: brew...
Read more >
How to Man in the Middle HTTPS Using mitmproxy - Earthly Blog
To see the docker daemon's incoming and outgoing requests, we need to get our proxy settings and our certificate authority into that VM....
Read more >
dutzi/tamper - Gitter
I am so close to have this working on MacOS Sierra. I got Chrome Extension connected with tamper.py and mitmproxy following the this...
Read more >
How to fix curl: (60) SSL certificate: Invalid certificate chain ...
To make sudo curl work (on OSX Sierra), we had to import the certificate into the System.keychain and trust it there. This could...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found