|
From: Yannick G. <yan...@sa...> - 2003-07-29 17:55:23
|
=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,=20
I try do customize the SafeTransport of xmlrpclib to do certificate
validation (signature and the like). I use you SecureXMLRPCServer
from the distribution.
It works perfectly if I keep the standard SafeTransport but if I try :=20
class CustomTransport(SafeTransport):
def make_connection(self, host):
conn =3D SafeTransport.make_connection(self, host)
addr =3D (conn._conn.host, conn._conn.port)
ctx =3D SSL.Context(SSL.SSLv23_METHOD)
ctx.set_options(SSL.OP_NO_SSLv2)
sslConn =3D SSL.Connection( ctx, socket.socket( socket.AF_INET,=20
socket.SOCK_DGRAM) )
sslConn.connect(addr)
sslConn.set_connect_state()
sslConn.renegotiate()
sslConn.do_handshake()
# must update the socket in conn here
print (sslConn.get_peer_certificate())
# do the certificate validation here
return conn
I receive this trace :
File "/usr/lib/python2.2/xmlrpclib.py", line 821, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.2/xmlrpclib.py", line 975, in __request
verbose=3Dself.__verbose
File "/usr/lib/python2.2/xmlrpclib.py", line 833, in request
h =3D self.make_connection(host)
File "/home/ygingras/BelugaERP/belugaerp/core/client/SimpleClient.py", li=
ne=20
32, in make_connection
sslConn.do_handshake()
SSL.Error [('SSL routines', 'SSL_clear', 'internal error')]
I'm not a SSL guru so I wonder what I may have done wrong. Is this
the right way to make a SLL connection with pyOpenSSL ? I use Python
2.2.2 on Red Hat 9. OpenSSL is a custom build of 0.9.7b (I tried
M2Crypto).
Thanks for your time !
=2D --=20
Yannick Gingras
Byte Gardener, Savoir-faire Linux inc.
(514) 276-5468
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/JrS5rhy5Fqn/MRARAllXAJwPOadpSKyCHOabVAlrd2qpgEYIeQCglf+i
e1MPRetViPH0ZXN/8G1AKKU=3D
=3DD+iG
=2D----END PGP SIGNATURE-----
|