python xmlrpc client with ssl client certificates and standard modules

News123 news123 at free.fr
Mon Jan 4 03:12:09 CET 2010


Hi,

I was googling fot quite some time and was not really succesfull.

I found one solution, which I will try soon.
It is
http://www.cs.technion.ac.il/~danken/xmlrpc-ssl.html
(found in
http://hamakor.org.il/pipermail/python-il/2008-February/000029.html )

This will probably work, but it requires the module M2Crypto.

In order to avoid installing M2Crypto an all hosts that want to run the
script I wondered, whether there is no other solution.

I can do xmlrpc over ssl WITHOUT certificates with following code:

import xmlrpclib
server_url = 'https://myserver'
server = xmlrpclib.Server(server_url);


and I can perform a https get request WITH certificates with below snippet:

import httplib
conn = httplib.HTTPSConnection(
    	HOSTNAME,
    	key_file = KEYFILE,
    	cert_file = CERTFILE
)
conn.putrequest('GET', '/')
conn.endheaders()
response = conn.getresponse()
print response.read()


I'm just lost of how to 'combine' both.


Thanks in advance for any suggestions / hints




N



More information about the Python-list mailing list