为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

慕虎7371278 2018-12-31 04:00:55
如何让Tornado网站同时支持http和https两种协议访问
查看完整描述

1 回答

?
慕村9548890

TA贡献1884条经验 获得超4个赞

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"),
})

查看完整回答
反对 回复 2019-01-16
  • 1 回答
  • 0 关注
  • 727 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信