title: Twisted listenSSL virtualhosts
body: <p>Currently using a really simple Twisted <code>NameVirtualHost</code> coupled with some JSON config files to serve really basic content in one <code>Site</code> object.  The resources being served by Twisted are all WSGI objects built in flask.</p>
  
  <p>I was wondering on how to go about wrapping the connections to these domains with an <code>SSLContext</code>, since <code>reactor.listenSSL</code> takes one and only one context, it isn't readily apparent how to give each domain/subdomain it's own crt/key pair.  Is there any way to set up named virtual hosting with ssl for each domain that doesn't require proxying?  I can't find any Twisted examples that use <code>NameVirtualHost</code> with SSL, and they only thing I could get to work is hook on the reactor listening on port 443 with only one domain's context?</p>
  
  <p>I was wondering if anyone has attempted this?</p>
  
  <p>My simple server without any SSL processing:</p>
  
  <p><a href="https://github.com/DeaconDesperado/twsrv/blob/master/service.py" rel="nofollow">https://github.com/DeaconDesperado/twsrv/blob/master/service.py</a></p>