<div dir="ltr">Hello,<div><br></div><div>A couple of days ago I asked on Stack Overflow about returning a deferred from an SNI callback and have pyOpenSSL wait for it to fire before continuing handling the request.</div><div><br></div><div>Thanks to some pointers by Gyph I've found a solution ("workaround") for my problem, involving a fake TLSMemoryBIOProtocol to handle the client hello until the SNI is received, firing the SNI callback, waiting for it to callback and then re-feeding the resulting context to the real TLSMemoryBIOProtocol.</div><div><br></div><div>The implementation of this solution is available at <a href="https://gist.github.com/GaretJax/124c523a62ba48c9eec1">https://gist.github.com/GaretJax/124c523a62ba48c9eec1</a>, and I'd like to contribute it back to Twisted, however, it has no unit tests and needs some design decisions/validation.</div><div><br></div><div>I've opened a ticket to track it at <a href="https://twistedmatrix.com/trac/ticket/8065">https://twistedmatrix.com/trac/ticket/8065</a>. Real-life impediments permitting, I'm willing to work on it and get the feature supported in Twisted core.</div><div><br></div><div>Anyone willing to help me getting a proper patch?</div><div><br></div><div>Best,</div><div>Jonathan</div><div><br></div><div>P.S.: A big shout-out to Twisted for its excellent TLS support out of the box. We got a straight A rating out of the box on ssl labs!</div><div><br></div><div><br></div></div>