Commit 18121159 authored by gerald2545's avatar gerald2545
Browse files

add the possibility to confgure jflow server to listen on secure port

(8083)
parent 97de99cf
......@@ -27,9 +27,16 @@ limit_submission = 100
server_socket_host = 127.0.0.1
# on which socket port should run the web server
server_socket_port = 8080
#server_socket_port = 8083
# date format
date_format = %d/%m/%Y
# data retention time (in years)
retention_time = 2
#optional : key for jflow server ssl configuration
ssl_certificate = certificate.crt
ssl_certificate_chain = certificate_chain.crt
ssl_private_key = private_key.key
[email]
# if you want an email to be sent at the end of the workflow execution
# set the smtp_server and the from_address values
......
......@@ -116,6 +116,12 @@ class JFlowConfigReader(object):
except:
return ["127.0.0.1", 8080]
def get_ssl_files(self):
try:
return [self.reader.get("global", "ssl_certificate"), self.reader.get("global", "ssl_certificate_chain"),self.reader.get("global", "ssl_private_key")]
except:
return []
def get_email_options(self):
try: smtps = self.reader.get("email", "smtp_server")
except: smtps = None
......
......@@ -140,6 +140,7 @@ class JFlowServer (object):
# define the socket host and port
jflowconf = JFlowConfigReader()
socket_opts = jflowconf.get_socket_options()
ssl_opts = jflowconf.get_ssl_files()
# add the result directory
if config is None or not '/' in config:
......@@ -162,6 +163,11 @@ class JFlowServer (object):
cherrypy.config.update({'server.socket_host': socket_opts[0],
'server.socket_port': socket_opts[1]})
if len(ssl_opts)==3:
cherrypy.config.update({'server.ssl_module': 'builtin',
'server.ssl_certificate': ssl_opts[0],
'server.ssl_certificate_chain': ssl_opts[1],
'server.ssl_private_key': ssl_opts[2]})
# start the server
cherrypy.quickstart(server_class(), config=config)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment