Basic SSL with Bottle

已查看 1,109 次
跳至第一个未读帖子

Matt Murfitt

未读,
2014年1月3日 12:43:072014/1/3
收件人 bott...@googlegroups.com
I like bottle because it's so lightweight, and I was looking into the easiest way to provide SSL support (without having to install other backends etc).

I've found a simple way to implement this based on the technique described here:

The idea is that you use a WSGIRefServer as before, but just wrap the socket with ssl prior to serving. I've uploaded an example to github if anyone's interested:


v+py...@g.nevcal.com

未读,
2019年4月7日 13:47:132019/4/7
收件人 bottlepy
Hi Matt,

Thanks for your bottle_ssl.py.  Seems to work fine. Based on my experience with the technique you started from, Python's SimpleHTTPServer didn't have threading, and when Chrome accesses a server via SSL, it needs at least two threads (Firefox doesn't), so to get SimpleHTTPServer going, required two patches.

However, once I applied your patch to bottle, I was surprised Chrome also worked with it... until I discovered that wsgi-multithread was True, so the wsgi code must already implement multithreading, even though in the DEPLOYMENT section of the bottle docs it mentions only being a single threaded server... maybe wsgi wasn't threaded when that was written but is now? I don't know the history.

Anyway, it is working great, some 5 years after you wrote your patch.
回复全部
回复作者
转发
0 个新帖子