Files
lrc/run.py
Tobias Kurze 0ee97589ee added cert
2019-03-19 16:34:27 +01:00

21 lines
654 B
Python
Executable File

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ssl
import logging
from backend import app
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
print(app.config.get("SERVER_NAME", None))
server_name = app.config.get("SERVER_NAME", None)
if server_name is not None and "ubkaps154.ubka.uni-karlsruhe.de" in server_name:
try:
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.load_cert_chain('cert.pem', 'key.pem')
app.run(debug=True, ssl_context=context, threaded=True)
except FileNotFoundError:
app.run(debug=True, threaded=True)
app.run(debug=True)