[Twisted-Python] Passing information from SSL postconnection check to application

Hi I have an application which uses M2Crypto authentication. I use the wrapper supplied by M2Crypto, and can do postConnection check just fine. I need to pass along some of the information from the client credentials, but I cannot figure out how to do this. The code looks something like this: from twisted.application import service, internet from twisted.protocols import policies from M2Crypto import SSL from M2Crypto.SSL.TwistedProtocolWrapper import TLSProtocolWrapper def protocol_factory(factory, wrapped_protocol): wrapper = TLSProtocolWrapper(factory, wrapped_protocol, startPassThrough=0, client=0, contextFactory=ServerContextFactory(), postConnectionCheck=MyChecker()) return wrapper factory = ... wrapper = policies.WrappingFactory(factory) wrapper.protocol = protocol_factory wrapper.protocol.TLS = True factory.startTLS = True factory.sslChecker = SSL.Checker.Checker() factory = wrapper application = service.Application('foo') service = internet.TCPServer(8443, factory) service.setServiceParent(application) Currently the original factory is the factory from twisted.web2, but I would like to be able to do this, on a general level, e.g., from AMP as well. Setting the information into some global value is sure to fail, but I cannot see how else to propagate information. -- - Henrik
participants (1)
-
Henrik Thostrup Jensen