views:

256

answers:

3

Hi folks,

I have a WSGI app that I would like to place behind SSL. My WSGI server is gevent.

What would a good way to serve the app through SSL in this case be?

+1  A: 

I would let the http server deal with the ssl transport.

dzen
+1  A: 

It looks like gevent now an ssl module. If you have a web server implemented on top of gevent, I imagine you could modify it to wrap incoming connections with that module's ssl socket class before passing it on to the http handlers.

http://blog.gevent.org/2010/02/05/version-0-12-0-released/

http://www.gevent.org/gevent.ssl.html

Otherwise, you could always use good old apache + mod_wsgi to serve your wsgi app.

Forest
+1  A: 

The gevent.wsgi module does not have built-in SSL support. If you're using it, put it behind nginx which would receive request over HTTPS but proxy them to your gevent app using non-encrypted HTTP.

The gevent.pywsgi module does have built-in SSL support and has compatible interface. Set keyfile and certfile arguments to make the server use SSL. Here's an example: wsgiserver_ssl.py.

Denis Bilenko