Dear List,
I saw that creating an XML-RPC client-server system in python is very simple.
However, when I wanted to see how to do it all over SSL, everything got
complicated. I'd like the server to authenticate the client, and hopefully vice
versa. What is the recommended way of doing it?
Random search has led me to pyOpenSSL examples, where one finds
SecureXMLRPCServer.py, which "acts exactly like SimpleXMLRPCServer".
What I had in mind is the following:
==== server.py ====
#import SimpleXMLRPCServer
import SecureXMLRPCServer
def echo(s):
return s
#s = SimpleXMLRPCServer.SimpleXMLRPCServer(('127.0.0.1', 4040))
s = SecureXMLRPCServer.SecureXMLRPCServer(('127.0.0.1', 4040))
s.register_function(echo, 'echo')
s.serve_forever()
==== client.py ====
import xmlrpclib
#server = xmlrpclib.Server('http://localhost:4040')
#print server.echo('hello')
server = xmlrpclib.Server('https://localhost:4040')
print server.echo('hello')
====
which ended with the client throwing xmlrpclib.ProtocolError: <ProtocolError for
localhost:4040/RPC2: 500 Internal Server Error>. This all worked nicely when I
tried it over http instead of https.
I am rather new to Python (and frankly, not very familiar with SSL), so
please be gentle :-)
--
Dan Kenigsberg http://www.cs.technion.ac.il/~danken ICQ 162180901
_______________________________________________
Python-il mailing list
[email protected]
http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il