猿问
下载APP

如何让Tornado网站同时支持http和https两种协议访问

如何让Tornado网站同时支持http和https两种协议访问


达令说
浏览 346回答 1
1回答

RISEBY

To make this server serve SSL traffic, send the ssl_options dictionary argument with the arguments required for the ssl.wrap_socket method, including certfile and keyfile. (In Python 3.2+ you can pass an ssl.SSLContext object instead of a dict):HTTPServer(applicaton, ssl_options={"certfile": os.path.join(data_dir, "mydomain.crt"),"keyfile": os.path.join(data_dir, "mydomain.key"),})
打开App,查看更多内容
随时随地看视频慕课网APP
我要回答