I’m trying to run mitmproxy and getting the following error:

Traceback (most recent call last):
  File "/usr/local/bin/mitmproxy", line 7, in <module>
    from mitmproxy.main import mitmproxy
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/", line 9, in <module>
    from mitmproxy import cmdline
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/", line 7, in <module>
    from mitmproxy import flowfilter
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/", line 41, in <module>
    from mitmproxy.models.http import HTTPFlow
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/models/", line 4, in <module>
    from .connections import ClientConnection, ServerConnection
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/models/", line 10, in <module>
    from netlib import certutils
  File "/usr/local/lib/python2.7/dist-packages/netlib/", line 13, in <module>
    import OpenSSL
  File "/usr/local/lib/python2.7/dist-packages/OpenSSL/", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/local/lib/python2.7/dist-packages/OpenSSL/", line 12, in <module>
    from OpenSSL._util import (
  File "/usr/local/lib/python2.7/dist-packages/OpenSSL/", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/", line 14, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/ undefined symbol: SSLv3_server_method**

How can I fix it?


This is caused by the cryptography Python module, which fails on your system when we just call import OpenSSL. You can probably fix your problem by upgrading/reinstalling cryptography and/or OpenSSL on your system.