Skip to content

Instantly share code, notes, and snippets.

@boxdot
Created April 12, 2016 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxdot/4b0686515574571e054dd8f4e41c3835 to your computer and use it in GitHub Desktop.
Save boxdot/4b0686515574571e054dd8f4e41c3835 to your computer and use it in GitHub Desktop.
# openssl req -nodes -x509 -new -keyout server.key -out server.crt
# brew install openssl
# pip install pyOpenSSL
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Flask is running!'
if __name__ == "__main__":
context = ('server.crt', 'server.key')
app.run(
host='0.0.0.0',
port=8080,
ssl_context=context,
threaded=True,
debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment