Customer tried to enable SSL termination on haproxy for all services, haproxy only listens to port 443.
Changed novncproxy_base_url:
from "http://.../vnc_auto.html"
to "https://.../vnc_auto.html?port=443" (https - needed for initial connection, ?port=443 needed to tell javascript to use port 443 for wss, otherwise it will connect to port 80)
Fuel 6.0
Customer tried to enable SSL termination on haproxy for all services, haproxy only listens to port 443.
Changed novncproxy_ base_url: .../vnc_ auto.html" /.../vnc_ auto.html? port=443" (https - needed for initial connection, ?port=443 needed to tell javascript to use port 443 for wss, otherwise it will connect to port 80)
from "http://
to "https:/
Result:
/var/log/ nova/consoleaut h.log: 05T21:23: 42.572675+ 00:00 warning: Checking Token: 8f9a0e2f- 0b0c-4e77- b816-bb618de5e2 e8/websockify, False
2015-10-
/var/log/ nova/nova- novncproxy. log: 05T21:23: 42.577323+ 00:00 info: handler exception: Invalid Token 05T21:23: 42.579856+ 00:00 debug: exception websocketproxy Traceback (most recent call last): websocketproxy File "/usr/lib/ python2. 7/dist- packages/ websockify/ websocket. py", line 874, in top_new_client websocketproxy client = self.do_ handshake( startsock, address) websocketproxy File "/usr/lib/ python2. 7/dist- packages/ websockify/ websocket. py", line 809, in do_handshake websocketproxy self.RequestHan dlerClass( retsock, address, self) websocketproxy File "/usr/lib/ python2. 7/dist- packages/ nova/console/ websocketproxy. py", line 150, in __init__ websocketproxy websockify. ProxyRequestHan dler.__ init__( self, *args, **kwargs) websocketproxy File "/usr/lib/ python2. 7/dist- packages/ websockify/ websocket. py", line 112, in __init__ websocketproxy SimpleHTTPReque stHandler. __init_ _(self, req, addr, server) websocketproxy File "/usr/lib/ python2. 7/SocketServer. py", line 638, in __init__ websocketproxy self.handle() websocketproxy File "/usr/lib/ python2. 7/dist- packages/ websockify/ websocket. py", line 540, in handle websocketproxy SimpleHTTPReque stHandler. handle( self) websocketproxy File "/usr/lib/ python2. 7/BaseHTTPServe r.py", line 340, in handle websocketproxy self.handle_ one_request( ) websocketproxy File "/usr/lib/ python2. 7/BaseHTTPServe r.py", line 328, in handle_one_request websocketproxy method() websocketproxy File "/usr/lib/ python2. 7/dist- packages/ websockify/ websocket. py", line 506, in do_GET websocketproxy if not self.handle_ websocket( ): websocketproxy File "/usr/lib/ python2. 7/dist- packages/ websockify/ websocket. py", line 494, in handle_websocket websocketproxy self.new_ websocket_ client( ) websocketproxy File "/usr/lib/ python2. 7/dist- packages/ nova/console/ websocketproxy. py", line 91, in new_websocket_ client websocketproxy raise Exception( _("Invalid Token")) websocketproxy Exception: Invalid Token websocketproxy
2015-10-
2015-10-
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
2015-10-05 23:23:42.578 108841 TRACE nova.console.
The issue happens In /usr/lib/ python2. 6/site- packages/ nova/console/ websocketproxy. py:
token = urlparse. parse_qs( query). get("token" , [""]).pop()
Will return <TOKEN>/websockify, so token will be concatenated with /websockify text, and cannot be validated.
The workaround I used to fix was to add an extra line:
token = token.split('/')[0]
After this change noVNC starts working well over https.
Also found a related bug - https:/ /bugs.launchpad .net/mos/ +bug/1460070