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?