Steven Roose
Steven Roose

Reputation: 2769

How to enable SSL for the built-in WSGI server from Python?

I run a WSGI application from within my Python file, using the make_server command.

(I don't know if this is a good practice or whether it is more common to setup Apache or nginx for this purpose.)

I want to make this little server secure by adding SSL support. Where do I start?

Is the built-in WSGI server from Python considered safe? I want the connection to be really secure. I only recently came across WSGI and I thought it was very easy to use, especially from within Python. The app is only used as a proxy so has little functionality, but I do want it to be as secure as possible.

Upvotes: 2

Views: 3313

Answers (1)

Basically WSGI is just an interface for communication between a web-server software (e.i. nginx or httpd) and your python script/app which contains some code to process requests (usually either application callable or applications list of callables).

You need to enable SSL on the web-server layer. But if you don't want to involve external software you may follow @Demz's advice and try using eventlet.wrap_ssl. Please find more relevant information here.

Upvotes: 1

Related Questions