# Path: app.py



import os
import sys
from OpenSSL import SSL
from app import app
# -*- coding: utf-8 -*-
"""
    security.https
    ~~~~~~~~~~~~~~

    How to serve HTTPS *directly* from Flask 
    http://flask.pocoo.org/snippets/111/
"""

sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.dirname(__file__))))




context = SSL.Context(SSL.SSLv23_METHOD)
context.use_privatekey_file('yourserver.key')
context.use_certificate_file('yourserver.crt')



# Path: app.py



# Path: security/serve_https.py
import os
import sys
from OpenSSL import SSL
from app import app

# -*- coding: utf-8 -*-
"""
    security.https
    ~~~~~~~~~~~~~~

    How to serve HTTPS *directly* from Flask 
    http://flask.pocoo.org/snippets/111/
"""

sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.dirname(__file__))))




context = SSL.Context(SSL.SSLv23_METHOD)
context.use_privatekey_file('yourserver.key')
context.use_certificate_file('yourserver.crt')



@app.route('/')