[英]Adding server certificate validation to httplib.HTTPSConnection
I've found that httplib.HTTPSConnection
doesn't perform an automatic server certificate check. 我发现
httplib.HTTPSConnection
不会执行自动服务器证书检查。 As far as I've understood the problem, I need to add that functionality manually, eg 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. 由于我正在使用Python2.4.5,并且在给定的情况下无法进行升级,因此我无法使用此博客文章中给出的解决方法,因为直到Py2.6才引入
ssl
模块。
I've been trying to avoid the usage of the ssl
module by using M2Crypto
. 我一直在尝试通过使用
M2Crypto
来避免使用ssl
模块。 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. 但是我还没有设法使用该方法适当地重写
httplib.HTTPSConnection.connect
。
Any ideas or hints? 有什么想法或提示吗?
Try this site maybe: http://www.cs.technion.ac.il/~danken/xmlrpc-ssl.html 尝试以下站点: http : //www.cs.technion.ac.il/~danken/xmlrpc-ssl.html
It requires SSL but doesn't require the Python SSL module. 它需要SSL,但不需要Python SSL模块。 It only requires Open SSL library.
它只需要Open SSL库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.