[Twisted-Python] reactor.connectSSL() error handling
Hi, I'm writing a distributed application using XML-RPC over SSL in Twisted. I need mutual authentication (server and client) but the XML-RPC Proxy in Twisted doesn't take any SSL context so I rewrote a Proxy by myself passing my ClientContextFactory subclass to reactor.connectSSL. Everything works fine but now I need to handle some possible error conditions that could prevent the connection, e.g wrong certificates, incompatible ciphersuite etc. In other words, I would like to catch these "exceptions" and handle them but I don't know how to do it in the Twisted framework (using Deferred I guess..). Any hint? Thank you.
On Sun, 28 May 2006 21:02:07 +0200, Lorenzo Allegrucci
Hi, I'm writing a distributed application using XML-RPC over SSL in Twisted. I need mutual authentication (server and client) but the XML-RPC Proxy in Twisted doesn't take any SSL context so I rewrote a Proxy by myself passing my ClientContextFactory subclass to reactor.connectSSL. Everything works fine but now I need to handle some possible error conditions that could prevent the connection, e.g wrong certificates, incompatible ciphersuite etc. In other words, I would like to catch these "exceptions" and handle them but I don't know how to do it in the Twisted framework (using Deferred I guess..). Any hint? Thank you.
SSL error handling is a weak area in Twisted. It's been improving, but it is still poorly documented. Perhaps you can motivate some further improvements :) However, the method you can use to "catch" exceptions related to connecting (SSL or otherwise) is http://twistedmatrix.com/documents/current/api/twisted.internet.protocol.Cli... HTH, -glyph
participants (2)
-
glyph@divmod.com
-
Lorenzo Allegrucci