[Twisted-Python] Where to catch ssl error exception?

Yun Mao maoy at cis.upenn.edu
Wed Feb 23 17:00:31 EST 2005


Suppose I'm the ssl server and a client didn't follow ssl protocol 
somewhere, I can get an exception like following. The qustion is how can 
I catch it?

Yun


2005/02/23 16:49 EST [HTTPChannel,21907,xx.xxx.xx.x] Traceback (most 
recent call last):
           File "/usr/lib/python2.3/site-packages/twisted/python/log.py", 
line 65, in callWithLogger
             callWithContext({"system": lp}, func, *args, **kw)
           File "/usr/lib/python2.3/site-packages/twisted/python/log.py", 
line 52, in callWithContext
             return context.call({ILogContext: newCtx}, func, *args, **kw)
           File 
"/usr/lib/python2.3/site-packages/twisted/python/context.py", line 43, in 
callWithContext
             return func(*args,**kw)
           File 
"/usr/lib/python2.3/site-packages/twisted/internet/default.py", line 535, 
in _doReadOrWrite
             why = getattr(selectable, method)()
         --- <exception caught here> ---
           File "/usr/lib/python2.3/site-packages/twisted/internet/tcp.py", 
line 98, in doRead
             return Connection.doRead(self)
           File "/usr/lib/python2.3/site-packages/twisted/internet/tcp.py", 
line 239, in doRead
             data = self.socket.recv(self.bufferSize)
         OpenSSL.SSL.Error: [('SSL routines', 'SSL23_READ', 'ssl handshake 
failure')]


Yun





More information about the Twisted-Python mailing list