Initial TLS support for VNC Websockets
PATCH 1/1 Initial TLS support for VNC Websockets
Added TLS support to the VNC QEMU Websockets implementation. VNC-TLS needs to be enabled for this feature to be used.
The required certificates are specified as in case of VNC-TLS with the VNC parameter "x509=<path>".
If the server certificate isn't signed by a rooth authority it needs to be manually imported in the browser because at least in case of Firefox and Chrome there is no user dialog, the connection just gets canceled.
As a side note VEncrypt over Websocket doesn't work atm because TLS can't be stacked in the current implementation. (It also didn't work before) Nevertheless to my knowledge there is no HTML 5 VNC client which supports it and the Websocket connection can be encrypted with regular TLS now so it should be fine for most use cases.
--- qemu-options.hx | 2 ++ ui/vnc-tls.c | 61 +++++++++++++++++++++++++--------------- ui/vnc-ws.c | 63 ++++++++++++++++++++++++++++++++++++++++++ ui/vnc-ws.h | 3 ++ ui/vnc.c | 86 ++++++++++++++++++++++++++++++++++++++++++++------------- ui/vnc.h | 5 +++- 6 files changed, 178 insertions(+), 42 deletions(-)
qemu-options.hx +2 -0
@@ -1127,6 +1127,8 @@ By definition the Websocket port is 5700+@var{display}. If @var{host} is specified connections will only be allowed from this host. As an alternative the Websocket port could be specified by using @code{websocket}=@var{port}. +TLS encryption for the Websocket connection is supported if the required +certificates are specified with the VNC option @option{x509}. @item password
ui/vnc-tls.c +39 -22
117 lines not on this page · raw message
ui/vnc-ws.c +63 -0
69 lines not on this page · raw message
ui/vnc-ws.h +3 -0
@@ -74,6 +74,9 @@ enum { WS_OPCODE_PONG = 0xA }; +#ifdef CONFIG_VNC_TLS +void vncws_tls_handshake_peek (void *opaque); +#endif /* CONFIG_VNC_TLS */ void vncws_handshake_read (void *opaque);long vnc_client_write_ws (VncState *vs);long vnc_client_read_ws (VncState *vs);
ui/vnc.c +67 -19
120 lines not on this page · raw message
ui/vnc.h +4 -1
@@ -278,9 +278,12 @@ struct VncStateVncStateSASL sasl;#endif #ifdef CONFIG_VNC_WS +#ifdef CONFIG_VNC_TLS +VncStateTLS ws_tls; +#endif /* CONFIG_VNC_TLS */ bool encode_ws;bool websocket; -#endif +#endif /* CONFIG_VNC_WS */ QObject *info;
Signature · 1 line
1.8.1.4
Hi,
did anybody had time yet to review my patch?
Regards
Tim
Signature · 5 lines
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany T: +49 (0) 911 74053-0 F: +49 (0) 911 74053-483 http://www.suse.de/