Reputation: 1
I'm running a website on Flask on an http link (the one provided by flask during development) but i would like to turn it https. How do i do it?
Searching on the web i've only found answers related to old Flask versions (i'm currently using Flask_2.2.4) where you could simply insert a parameter inside the "app.run()" function indicating that the server should be https, but i think that it's not working anymore. Anything would be helpful, thank you in advance for the answers.
Upvotes: 0
Views: 946
Reputation: 1
If you're using flask run you can add --cert=adhoc to the end.
Example: flask run --cert=adhoc
.
If you're using app.run you can do app.run(ssl_context='adhoc')
.
However you will get a warning from your browser saying this site is not secure, etc.
In order to do this you need to do pip install pyopenssl
Upvotes: 0