By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,312 Members | 1,666 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,312 IT Pros & Developers. It's quick & easy.

secure xmlrpc server?

P: n/a

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

Jun 7 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Laszlo Nagy wrote:
<cut ssl for xmlrpc>
Have a look at:
http://trevp.net/tlslite/

--
mph
Jun 7 '06 #2

P: n/a
Martin P. Hellwig wrote:
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

Jun 7 '06 #3

P: n/a
Laszlo Nagy wrote:
Martin P. Hellwig wrote:
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>


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.

Thanks,

Laszlo

--
mph
Jun 7 '06 #4

P: n/a
Martin P. Hellwig írta:
Laszlo Nagy wrote:
Martin P. Hellwig wrote:
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>


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/Coo...n/Recipe/81549
http://aspn.activestate.com/ASPN/Coo.../Recipe/165375

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

class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTP RequestHandler):

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

Jun 7 '06 #5

P: n/a
Laszlo Nagy wrote:
<cut>
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
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/Coo...n/Recipe/81549
http://aspn.activestate.com/ASPN/Coo.../Recipe/165375

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

class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTP RequestHandler):

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/publi...xIn-class.html

--
mph
Jun 7 '06 #6

P: n/a
Laszlo Nagy wrote:
But I do not know how to create an XML RPC server in Python that uses
HTTPS for XML transports.


This recent recipe seems to do exactly what you want:
http://aspn.activestate.com/ASPN/Coo.../Recipe/496786

Kent
Jun 9 '06 #7

P: n/a
Kent Johnson wrote:
Laszlo Nagy wrote:
But I do not know how to create an XML RPC server in Python that uses
HTTPS for XML transports.


This recent recipe seems to do exactly what you want:
http://aspn.activestate.com/ASPN/Coo.../Recipe/496786


It was gently pointed out to me that the OP is the author of the
recipe...well I guess he figured it out!

That will teach me to get two days behind on reading c.l.py...
Jun 9 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.