libmproxy问题 - '模块'对象没有属性' TLSv1_1_METHOD'

时间:2016-01-19 13:08:38

标签: python-2.7 mitmproxy libmproxy

我尝试在我的Linux RHEL 7上使用Libmproxy,得到以下异常:

    from libmproxy import controller, proxy
  File "/usr/lib/python2.7/site-packages/libmproxy/proxy/__init__.py", line 1, in <module>
    from .primitives import *
  File "/usr/lib/python2.7/site-packages/libmproxy/proxy/primitives.py", line 2, in <module>
    from netlib import socks, tcp
  File "/usr/lib/python2.7/site-packages/netlib/socks.py", line 5, in <module>
    from . import tcp, utils
  File "/usr/lib/python2.7/site-packages/netlib/tcp.py", line 62, in <module>
    "TLSv1_1": (SSL.TLSv1_1_METHOD, SSL_BASIC_OPTIONS),
AttributeError: 'module' object has no attribute 'TLSv1_1_METHOD'

已经尝试重新安装mitmproxy,netlib,PyOpenSSL和Cryptography。 还有其他想法吗?

2 个答案:

答案 0 :(得分:0)

This looks like a very outdated version of OpenSSL installed on your system. Update OpenSSL/libssl and you should be fine.

答案 1 :(得分:0)

这不是你的错。您正在使用的OpenSSL版本是在删除TLSv1.1支持的情况下编译的。这是假设@Override protected void onCreate(Bundle savedInstanceState) { // [...] Toolbar tb = (Toolbar) findViewById(R.id.toolbar_my); setSupportActionBar(tb); if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); tb.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { onBackPressed(); //goes to the previous fragment } }); // [...] } @Override public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()) { case R.id.foo: // do something return true; default: return false; } } 可用的mitmproxy中的错误。