aboutsummaryrefslogtreecommitdiffstats
path: root/config_binding_service/run.py
diff options
context:
space:
mode:
authorTommy Carpenter <tommy@research.att.com>2019-05-31 09:21:31 -0400
committerTommy Carpenter <tommy@research.att.com>2019-06-05 11:59:13 +0000
commitcbbf7f93f272ddff1c615eb287c7556972a16357 (patch)
tree967e7e536f0428410c19443d776ab28e9c468ee1 /config_binding_service/run.py
parente14b49ead38227ff17d760c4771d58d9c6d2e7c0 (diff)
Add HTTPS Flag
Issue-ID: DCAEGEN2-1549 Change-Id: I24f84d13ddc4e4163c02814c2f841a5485dbf7a7 Signed-off-by: Tommy Carpenter <tommy@research.att.com>
Diffstat (limited to 'config_binding_service/run.py')
-rwxr-xr-xconfig_binding_service/run.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/config_binding_service/run.py b/config_binding_service/run.py
index 175c0cf..a161c53 100755
--- a/config_binding_service/run.py
+++ b/config_binding_service/run.py
@@ -21,12 +21,19 @@ import os
from gevent.pywsgi import WSGIServer
from config_binding_service.logging import create_loggers, DEBUG_LOGGER
from config_binding_service import app
+from config_binding_service import utils
def main():
"""Entrypoint"""
if "PROD_LOGGING" in os.environ:
create_loggers()
- DEBUG_LOGGER.debug("Starting gevent server")
- http_server = WSGIServer(("", 10000), app)
+ key_loc, cert_loc = utils.get_https_envs()
+ if key_loc:
+ DEBUG_LOGGER.debug("Starting gevent server as HTTPS")
+ http_server = WSGIServer(("", 10443), app, keyfile=key_loc, certfile=cert_loc)
+ else:
+ DEBUG_LOGGER.debug("Starting gevent server as HTTP")
+ http_server = WSGIServer(("", 10000), app)
+
http_server.serve_forever()