将服务器证书验证添加到 httplib.HTTPSConnection

发布于 2024-09-10 07:28:49 字数 616 浏览 2 评论 0原文

我发现 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过去的过去 2024-09-17 07:28:50

尝试一下这个网站: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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文