NISHIO Hirokazu[Translate]
FlaskのHTTPS化
answered Dec 5 '20 by Mark Dominusの回答
python
import ssl context = ssl.SSLContext() context.load_cert_chain('fullchain.pem', 'privkey.pem') ... app.run(…, ssl_context=context)
'fullchain.pem', 'privkey.pem'は LetsEncrypt Certbot が作る


$ flask run --cert fullchain.pem --key privkey.pem

"Engineer's way of creating knowledge" the English version of my book is now available on [Engineer's way of creating knowledge]

(C)NISHIO Hirokazu / Converted from [Scrapbox] at [Edit]