File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ def parse_args():
3636 parser .add_argument ('-d' , '--debug' , action = 'store_true' ,
3737 help = 'Enable debugging' )
3838
39+ parser .add_argument ('-C' , '--ssl-cert' , type = str ,
40+ help = "Use a ssl certificate, `adhoc` to autogenerate a self-signed one" )
41+
42+ parser .add_argument ('-K' , '--ssl-key' , type = str ,
43+ help = "Use a ssl private key, omit it if you want to use an autogenerated cert/key" )
44+
3945 return parser .parse_args ()
4046
4147
@@ -70,10 +76,18 @@ def create_app(cmdline_args):
7076def run ():
7177 cmdline_args = parse_args ()
7278 app = create_app (cmdline_args )
73- app .run (debug = cmdline_args .debug ,
79+
80+ kwargs = dict (debug = cmdline_args .debug ,
7481 host = cmdline_args .host , port = cmdline_args .port ,
7582 threaded = cmdline_args .threaded )
7683
84+ if cmdline_args .ssl_cert == 'adhoc' :
85+ kwargs ['ssl_context' ] = 'adhoc'
86+
87+ print (kwargs )
88+
89+ app .run (** kwargs )
90+
7791
7892if __name__ == '__main__' :
7993 run ()
You can’t perform that action at this time.
0 commit comments