xmlrpc ssl (slightly embarrassing, long post)

Rune Hansen rune.hansen at sinsenveien83.com
Thu Jun 5 16:04:16 CEST 2003


I'm using the OpenSSL library:
# Copyright (C) AB Strakt 2001, All rights reserved
#
# $Id: __init__.py,v 1.1.1.1 2002/06/07 21:13:41 misa Exp $

I'll take a look at M2Crypto

Thanks

/rune

Ng Pheng Siong wrote:
> According to Rune Hansen  <rune.hansen at sinsenveien83.com>:
> 
>>     def __init__(self, server_address, RequestHandlerClass):
>>         """Constructor.  May be extended, do not override."""
>>         BaseServer.__init__(self, server_address, RequestHandlerClass)
>>	#OpenSSL
>>         ctx = SSL.Context(SSL.SSLv23_METHOD)
>>         ctx.set_options(SSL.OP_NO_SSLv2)
>>         ctx.set_verify(SSL.VERIFY_PEER, verify_cb)
>>         ctx.use_privatekey_file ('key.pem')
>>         ctx.use_certificate_file('cert.pem')
>>         self.socket = 
>>SSL.Connection(ctx,socket.socket(self.address_family,self.socket_type))
> 
> 
> Not sure which SSL library you're using, but M2Crypto's works:
> 
> In one window:
> 
>   ngps at vista:~/prog/ngps/m2/demo/medusa$ python START_xmlrpc.py
>   info: Medusa (V1.1) started at Thu Jun  5 21:43:38 2003
>           Hostname: vista.netmemetic.com
>           Port:9080
>   
>   warning: Computing default hostname
>   info: Medusa (V1.1) started at Thu Jun  5 21:43:38 2003
>           Hostname: vista.netmemetic.com
>           Port:9443
>   
>   M2Crypto HTTPS Server (v0.09)
> 
> In another window:
> 
>   ngps at vista:~/prog/ngps/m2/demo/ssl$ python xmlrpc_cli.py
>   Sure, that works
>   Sure, that works
> 
> First window says:
> 
>   method="Testing" params=(1, 2, 3)
>   127.0.0.1:1028 - - [05/Jun/2003:13:44:03 +0800] "POST /RPC2 HTTP/1.0" 200 242
>   method="BringOn" params=('SOAP',)
>   127.0.0.1:1029 - - [05/Jun/2003:13:44:03 +0800] "POST /RPC2 HTTP/1.0" 200 242
> 
> There is also a demo server based on TCPServer.
> 
> 
> 





More information about the Python-list mailing list