Add support for secure websocket connection

Add a few SSL config for operator to turn on secure connection
on zun websocket proxy.

Change-Id: Ica077eda90e0d782c206eea7c446b6af646668f8
Closes-Bug: #1762511
(cherry picked from commit 1bb994962b)
This commit is contained in:
Hongbin Lu 2018-11-25 16:21:50 +00:00
parent ee5c0e623c
commit b8d8595fa3
2 changed files with 11 additions and 0 deletions

View File

@ -34,6 +34,9 @@ def main():
websocketproxy.ZunWebSocketProxy(
listen_host=host,
listen_port=port,
cert=CONF.websocket_proxy.cert,
key=CONF.websocket_proxy.key,
ssl_only=CONF.websocket_proxy.ssl_only,
file_only=True,
RequestHandlerClass=websocketproxy.ZunProxyRequestHandler
).start_server()

View File

@ -78,6 +78,14 @@ Possible values:
* A list where each element is an allowed origin hostnames, else an empty list
"""),
cfg.BoolOpt('ssl_only',
help="Disallow non-encrypted connections."),
cfg.StrOpt('cert',
default='',
help="Path to SSL certificate file."),
cfg.StrOpt('key',
default='',
help="SSL key file (if separate from cert)."),
]
ALL_OPTS = (wsproxy_opts)