Commit 1af3e54b authored by Joel Martin's avatar Joel Martin

Make WebSocket encrypt setting default to page protocol.

I.e. if the page is https:// then the WebSocket encrypt setting will
default to wss:// (TLS encryption).

Note that since noVNC settings are saved in cookies, this will only
affect first load. If you have already loaded the page, then the
encrypt setting will be whatever you last set it to.
parent 6a02f88e
...@@ -48,7 +48,7 @@ load: function() { ...@@ -48,7 +48,7 @@ load: function() {
UI.initSetting('host', ''); UI.initSetting('host', '');
UI.initSetting('port', ''); UI.initSetting('port', '');
UI.initSetting('password', ''); UI.initSetting('password', '');
UI.initSetting('encrypt', false); UI.initSetting('encrypt', (window.location.protocol === "https:"));
UI.initSetting('true_color', true); UI.initSetting('true_color', true);
UI.initSetting('cursor', false); UI.initSetting('cursor', false);
UI.initSetting('shared', true); UI.initSetting('shared', true);
......
...@@ -101,7 +101,8 @@ ...@@ -101,7 +101,8 @@
} }
rfb = new RFB({'target': $D('noVNC_canvas'), rfb = new RFB({'target': $D('noVNC_canvas'),
'encrypt': WebUtil.getQueryVar('encrypt', false), 'encrypt': WebUtil.getQueryVar('encrypt',
(window.location.protocol === "https:")),
'true_color': WebUtil.getQueryVar('true_color', true), 'true_color': WebUtil.getQueryVar('true_color', true),
'local_cursor': WebUtil.getQueryVar('cursor', true), 'local_cursor': WebUtil.getQueryVar('cursor', true),
'shared': WebUtil.getQueryVar('shared', true), 'shared': WebUtil.getQueryVar('shared', true),
......
Markdown is supported
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