Merge "API: Use SSL to listen on"
This commit is contained in:
commit
971f37d680
@ -87,6 +87,8 @@ db_schema=lbaas
|
|||||||
gearman=127.0.0.1:4730
|
gearman=127.0.0.1:4730
|
||||||
swift_basepath=lbaaslogs
|
swift_basepath=lbaaslogs
|
||||||
swift_endpoint=https://host.com:443/v1/
|
swift_endpoint=https://host.com:443/v1/
|
||||||
|
ssl_certfile=certfile.crt
|
||||||
|
ssl_keyfile=keyfile.key
|
||||||
|
|
||||||
# Keystone options go here
|
# Keystone options go here
|
||||||
[keystone]
|
[keystone]
|
||||||
|
@ -99,7 +99,7 @@ def main():
|
|||||||
default='0.0.0.0'
|
default='0.0.0.0'
|
||||||
)
|
)
|
||||||
options.parser.add_argument(
|
options.parser.add_argument(
|
||||||
'--port', help='Port number for API server', type=int, default=8080
|
'--port', help='Port number for API server', type=int, default=443
|
||||||
)
|
)
|
||||||
options.parser.add_argument(
|
options.parser.add_argument(
|
||||||
'--disable_keystone', help='Unauthenticated server, for testing only',
|
'--disable_keystone', help='Unauthenticated server, for testing only',
|
||||||
@ -134,12 +134,20 @@ def main():
|
|||||||
'--swift_endpoint',
|
'--swift_endpoint',
|
||||||
help='Default endpoint URL (tenant ID will be appended to this'
|
help='Default endpoint URL (tenant ID will be appended to this'
|
||||||
)
|
)
|
||||||
|
options.parser.add_argument(
|
||||||
|
'--ssl_cert',
|
||||||
|
help='Path to an SSL certificate file'
|
||||||
|
)
|
||||||
|
options.parser.add_argument(
|
||||||
|
'--ssl_keyfile',
|
||||||
|
help='Path to an SSL key file'
|
||||||
|
)
|
||||||
|
|
||||||
args = options.run()
|
args = options.run()
|
||||||
|
|
||||||
required_args = [
|
required_args = [
|
||||||
'db_user', 'db_pass', 'db_host', 'db_schema', 'swift_basepath',
|
'db_user', 'db_pass', 'db_host', 'db_schema', 'swift_basepath',
|
||||||
'swift_endpoint'
|
'swift_endpoint', 'ssl_certfile', 'ssl_keyfile'
|
||||||
]
|
]
|
||||||
|
|
||||||
missing_args = 0
|
missing_args = 0
|
||||||
@ -184,6 +192,14 @@ def main():
|
|||||||
logger.info('Starting on {0}:{1}'.format(args.host, args.port))
|
logger.info('Starting on {0}:{1}'.format(args.host, args.port))
|
||||||
api = setup_app(pc, args)
|
api = setup_app(pc, args)
|
||||||
sys.stderr = LogStdout(logger)
|
sys.stderr = LogStdout(logger)
|
||||||
wsgi.server(eventlet.listen((args.host, args.port)), api)
|
wsgi.server(
|
||||||
|
eventlet.wrap_ssl(
|
||||||
|
eventlet.listen((args.host, args.port)),
|
||||||
|
certfile=args.ssl_certfile,
|
||||||
|
keyfile=args.ssl_keyfile,
|
||||||
|
server_side=True
|
||||||
|
),
|
||||||
|
api
|
||||||
|
)
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user