./20170526-2040-cet-deploying-flask-with-https-1.png

  • Screenshot from "How To Deploy A Flask Application On Ubuntu VPS" tutorial.

./20170526-2040-cet-deploying-flask-with-https-2.png

  • Screenshot from basic server setup for Ubuntu 16.04 LTS as a DigitalOcean droplet tutorial.

./20170526-2040-cet-deploying-flask-with-https-3.png

  • Screenshot from StackOverflow about adding SSL certificate in Flask based application.

./20170526-2040-cet-deploying-flask-with-https-4.png

  • This posts is what specifically solve my problem.

./20170526-2040-cet-deploying-flask-with-https-5.png

  • Screenshot from StackOverflow about my progress into getting HTTPS ready Flask application.

./20170526-2040-cet-deploying-flask-with-https-6.png

  • Here is my sample codes to employ SSL certs with SocketIO enabled.
context = ("/etc/ssl/certs/apache-selfsigned.crt", "/etc/ssl/private/apache-selfsigned.key")
if   online: sIO.run(app, host="0.0.0.0", ssl_context=context)
else       : sIO.run(app)