美文网首页
flask https配置

flask https配置

作者: 不死鸟F21 | 来源:发表于2022-03-22 14:37 被阅读0次

from flask import Flask
from flask_restful import Resource, Api

app = Flask(name)
api = Api(app)

class Index(Resource):
def get(self):
return {'hello': 'world'}

api.add_resource(Index, '/index')

if name == 'main':
app.run(debug=True, host='0.0.0.0', port=443, ssl_context=('secret.pem', 'secret.key'))

证书:
openssl req -new -x509 -days 365 -nodes -out secret.pem -keyout secret.key
openssl pkcs8 -topk8 -inform PEM -outform PEM -in secret.key -out outfile.pem

相关文章

网友评论

      本文标题:flask https配置

      本文链接:https://www.haomeiwen.com/subject/rxufjrtx.html