Adding server certificate verification to httplib.HTTPSConnection

I found that httplib.HTTPSConnection does not validate the automatic server certificate. As far as I understand the problem, I need to add this functionality manually, for example. by subclassing this class as described here .

Since I am using Python2.4.5, and updating is not possible in the circumstances, I cannot use the workaround given in this blog post because the ssl module was not introduced before Py2.6.

I tried to avoid using the ssl module using M2Crypto . A promising approach for this is contained in this blog post (under the Clients section). But I have not yet been able to override httplib.HTTPSConnection.connect accordingly using this approach.

Any ideas or tips?

+4
source share
1 answer

Try this site, perhaps: http://www.cs.technion.ac.il/~danken/xmlrpc-ssl.html

It requires SSL, but does not require the Python SSL module. This requires the Open SSL library.

+2
source

Source: https://habr.com/ru/post/1316151/


All Articles