secure xmlrpc server?

L

Laszlo Nagy

Hello,

I'm trying to create a simple XMLRPC server and a client. It is a small
application, but the connection needs to be secure. I would like the
client to be as thin as possible. Ideally, the client should only
require the basic python library, nothing else. I found many examples on
the net. But I could not find secure ones (except twisted/xmlrpc, but I
would like to use the basic python lib on the client side, if possible).
I know that python supports HTTPS. In theory, this could be used to
bulild a secure xmlrpc server. I think that the client would work with
this code:

# Connect to server
server = ServerProxy("https://myserver.com:8000")

But I do not know how to create an XML RPC server in Python that uses
HTTPS for XML transports. (The server may use other libraries, just the
client needs to be thin.)
Can you help me please?

Thanks,

Laszlo
 
L

Laszlo Nagy

Martin said:
Laszlo Nagy wrote:
<cut ssl for xmlrpc>
Have a look at:
http://trevp.net/tlslite/
C:\temp\ccc>python setup.py install
running install
running build
running build_py
running build_ext
error: The .NET Framework SDK needs to be installed before building
extensions f
or Python.

C:\temp\ccc>


Does it mean that .NET framework is required for tlslite on Windows?

Also can you please provide an example for tlslite/xmlrpc integration?
The documentation of tlslite is very detailed, but it has many options
and I could not find an example.

Thanks,

Laszlo
 
M

Martin P. Hellwig

Laszlo said:
C:\temp\ccc>python setup.py install
running install
running build
running build_py
running build_ext
error: The .NET Framework SDK needs to be installed before building
extensions f
or Python.

C:\temp\ccc>

In the installers directory is exe for windows installation.
Does it mean that .NET framework is required for tlslite on Windows?

Also can you please provide an example for tlslite/xmlrpc integration?
The documentation of tlslite is very detailed, but it has many options
and I could not find an example.

SimpleXMLRPCServer uses SimpleHTTPServer for its transfer stuff, so you
might want to look more in that direction.
 
L

Laszlo Nagy

Martin P. Hellwig írta:
In the installers directory is exe for windows installation.
http://trevp.net/tlslite/ - no exe installers.
http://sourceforge.net/projects/tlslite/ - no file packages to download

:-(
SimpleXMLRPCServer uses SimpleHTTPServer for its transfer stuff, so you
might want to look more in that direction.
Yes, In fact I read the whole source code of SimpleXMLRPCServer and
other examples like

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81549
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/165375

but I cannot combine the two. I see that the request handler is a
customised HTTP request handler:

class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):

but I have no idea how to use it with https. Do you know a small example
(like the ones above)? That would help a lot.

Laszlo
 
M

Martin P. Hellwig

Laszlo Nagy wrote:
http://trevp.net/tlslite/ - no exe installers.
http://sourceforge.net/projects/tlslite/ - no file packages to download

:-(

Download the zip and unpack it:
http://trevp.net/tlslite/tlslite-0.3.8.zip
Then there is an installers directory
Yes, In fact I read the whole source code of SimpleXMLRPCServer and
other examples like

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81549
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/165375

but I cannot combine the two. I see that the request handler is a
customised HTTP request handler:

class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):

but I have no idea how to use it with https. Do you know a small example
(like the ones above)? That would help a lot.

Laszlo

Something like:

import SocketServer
import SimpleXMLRPCServer
import tlslite.api

# Overriding with ThreadingMixIn and TLSSocketServerMixIN
# to create a secure async server.
class txrServer(SocketServer.ThreadingMixIn,
tlslite.api.TLSSocketServerMixIn,
SimpleXMLRPCServer.SimpleXMLRPCServer):
pass


But the above is untested (been a while ago, since I experimented with
it, for my case it was more functional to use VPN's instead of SSL/TLS).

For the rest you can follow the same principals as for the SimpleHTTPServer:

http://trevp.net/cryptoID/docs/publ...etServerMixIn.TLSSocketServerMixIn-class.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top