通过python 2.7进行NTLM v2身份验证

时间:2013-12-08 17:29:21

标签: python python-2.7 ntlm activestate ntlmv2

我正在实施NTLMv2身份验证。使用activestate python 2.7.5.6。来自https://code.google.com/p/python-ntlm/的NTLM urllib2中似乎存在一个错误,因为通过身份验证的代理访问https网址没有成功http://bugs.python.org/issue7291

  File "/usr/lib/python2.7/urllib2.py", line 1121, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error Tunnel connection failed: 407 Proxy
Authentication Required>

This is because HTTPConnection::_tunnel() in httplib.py doesn't send
Proxy-Authorization header.

我们面临的Python错误是在python 2.6.X中报告的,修复也是python 2.7.6(http://www.python.org/getit/releases/2.7.6/)的一部分,它是在2.7.5.6之后发布的。这是根据2.7.6的发行说明。(http://hg.python.org/cpython/raw-file/99d03261c1ba/Misc/NEWS) - 在2.7.6的发行说明中错误地提到了#7291(http://bugs.python.org/issue7291)错误7231。虽然描述是正确的。 - 我检查了源代码,并没有在python 2.7.6中看到此问题的代码更改,尽管发行说明说bug修复是发布的一部分。我在错误跟踪系统中打开的问题中对提到的提交(http://bugs.python.org/file20824/http_proxy_https.patch)进行了交叉检查。 - ActiveState python目前不支持python 2.7.6(http://www.activestate.com/activepython/downloads)(2013年11月10日发布2.7.6)

所以需要选择哪个版本的python,或者是否有其他方法在python中实现NTLMv2。

0 个答案:

没有答案