iro/xmlrpc/SecureAuthentificateXMLRPCServer.py
changeset 302 3f4bdea2abbf
parent 90 eb04ac3a8327
parent 301 d5ebbcccc41b
child 303 9708742ff89c
equal deleted inserted replaced
90:eb04ac3a8327 302:3f4bdea2abbf
     1 # Server code
       
     2 import AuthentificateXMLRPCServer
       
     3 import SecureXMLRPCServer
       
     4 
       
     5 class SecureAuthentificateXMLRPCRequestHandler(SecureXMLRPCServer.SecureXMLRPCRequestHandler,AuthentificateXMLRPCServer.AuthentificateXMLRPCRequestHandler):
       
     6     def do_POST(self):
       
     7         AuthentificateXMLRPCServer.AuthentificateXMLRPCRequestHandler.do_POST(self)
       
     8 
       
     9 
       
    10 def test():
       
    11     server = SecureXMLRPCServer.SecureXMLRPCServer(("localhost", 8000),requestHandler=SecureAuthentificateXMLRPCRequestHandler,certificate="./certs/test.cert.pem",privatekey="./certs/test.key.pem")
       
    12     server.relam="xmlrpc"
       
    13     server.register_introspection_functions()
       
    14     server.register_function(lambda x: x*x, 'square')
       
    15     server.serve_forever()
       
    16 
       
    17 if __name__ == '__main__':
       
    18     test()
       
    19 
       
    20