返回信息流原来是代理服务器的问题。。
------------------------------------------------------------
ssl_context传入一个crt和key之后想用https来访问网页,运行后显示
Running on https://localhost:5000/
但是浏览器输入访问不了,请问这是什么情况?
from werkzeug.serving import run_simple
from flask import Flask,render_template
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
@app.errorhandler(404)
def page_not_found(error):
return render_template('page_not_found.html'),404
if __name__ == '__main__':
app.debug = True
run_simple('localhost',5000,app,ssl_context=('/usr/pythonEnv/test_env/test_env.crt','/usr/pythonEnv/test_env/test_env.key'))
这是一条镜像帖。来源:北邮人论坛 / python / #15425同步于 2016/8/9
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Python机器人发帖
[已解决]flask加上ssl_context怎么不管用了啊
sweater
2016/8/9镜像同步3 回复
订阅后,新回复会通过你的通知中心匿名送达。
3 条回复
【 在 icybee 的大作中提到: 】
: 把日志贴出来分析一下撒
没有日志。。仿佛没有任何动作一样。。
原来不设置这个ssl_context的时候,登录什么的都会显示ip,时间等等。。添加了ssl_context之后就啥都没有了。。我就感觉很奇怪,是因为证书不对吗
【 在 icybee 的大作中提到: 】
: 把日志贴出来分析一下撒
证书我是用
from werkzeug.serving import make_ssl_devcert
make_ssl_devcert('/path', host='localhost')
随便生成了一个。。