简体   繁体   中英

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.

Basically WSGI is just an interface for communication between a web-server software (ei 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM