将服务器证书验证添加到 httplib.HTTPSConnection
我发现 httplib.HTTPSConnection
不执行自动服务器证书检查。据我了解这个问题,我需要手动添加该功能,例如通过按描述的方式对此类进行子类化 这里。
由于我使用的是 Python2.4.5 并且在给定情况下无法升级,因此我无法使用本文中给出的解决方法,因为直到 Py2.6 才引入 ssl
模块。
我一直在尝试通过使用 M2Crypto
来避免使用 ssl
模块。 此博客中包含一种有前景的方法发布(在“客户”部分)。但我还没有成功地使用这种方法来适当地覆盖 httplib.HTTPSConnection.connect
。
有什么想法或提示吗?
I've found that httplib.HTTPSConnection
doesn't perform an automatic server certificate check. As far as I've understood the problem, I need to add that functionality manually, e.g. by subclassing this class as described here.
As I'm using Python2.4.5 and an upgrade is not possible under the given circumstances, I cannot use the workaround given in this blog post, because the ssl
module has not been introduced until Py2.6.
I've been trying to avoid the usage of the ssl
module by using M2Crypto
. A promising approach for doing so is contained in this blog post (in the "Clients" section). But I haven't yet managed to override httplib.HTTPSConnection.connect
appropriately by using that approach.
Any ideas or hints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试一下这个网站:http://www.cs.technion。 ac.il/~danken/xmlrpc-ssl.html
它需要 SSL,但不需要 Python SSL 模块。它只需要 Open SSL 库。
Try this site maybe: http://www.cs.technion.ac.il/~danken/xmlrpc-ssl.html
It requires SSL but doesn't require the Python SSL module. It only requires Open SSL library.