iro/xmlrpc/SecureAuthentificateXMLRPCServer.py
author Sandro Knauß <knauss@netzguerilla.net>
Sat, 08 Oct 2011 12:32:58 +0200
changeset 66 eabb8ead183d
parent 0 a3b6e531f0d2
permissions -rw-r--r--
Added dump_test_log.py from http://hieuhacking.blogspot.com/2009/09/log-rotation-for-python-process.html Added testloglock.py from http://cherrypy.org/attachment/ticket/679/testloglock.py

# Server code
import AuthentificateXMLRPCServer
import SecureXMLRPCServer

class SecureAuthentificateXMLRPCRequestHandler(SecureXMLRPCServer.SecureXMLRPCRequestHandler,AuthentificateXMLRPCServer.AuthentificateXMLRPCRequestHandler):
    def do_POST(self):
        AuthentificateXMLRPCServer.AuthentificateXMLRPCRequestHandler.do_POST(self)


def test():
    server = SecureXMLRPCServer.SecureXMLRPCServer(("localhost", 8000),requestHandler=SecureAuthentificateXMLRPCRequestHandler,certificate="./certs/test.cert.pem",privatekey="./certs/test.key.pem")
    server.relam="xmlrpc"
    server.register_introspection_functions()
    server.register_function(lambda x: x*x, 'square')
    server.serve_forever()

if __name__ == '__main__':
    test()