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