LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

WSS: Secure websockets in NXG WebVI? Getting errors.

Greetings-

We are hosting a WebVI on a public installation of NI Web Server. We have HTTPS / certificate based security configured and working well.

 

Our WebVI needs to request low-latency data from another source, so we've selected Websockets. On the other end of the connection is a LabVIEW-build which contains a WS (websockets) and a WSS (secure websockets over TLS) listener (on different ports of course. We're using MediaMongrels kit for the websockets in LV). Communication to our WSS server from a test client works as intended.

 

Problem we're running into is upon viewing the WebVI, we get an output error saying:

"Error \:\:Web\ Server\:\:Interactive\:\:WebApp\:\:index\.gviweb::::WebApp JavaScript message: Mixed Content: The page at 'https://<our HTTPS server>/nxgproxy/53825/HtmlVI/Run/Web%20Server/Interactive/WebApp/index.html' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://<our WS server>/'. This request has been blocked; this endpoint must be available over WSS. in IdeRun.min.js at line 7949"

 

So, we need to switch to WSS, got it. Problem is, we can't figure out how to use NXG to connect to a WSS server (with TLS certs). There appears to be no inputs for Cert files, and a OS-loaded root cert didn't work either. 

 

The NXG Websocket feature advertised WSS support (https://www.ni.com/documentation/en/labview-web-module/latest/web-mod-node-ref/open-websocket/), and indeed the example on NI's github (https://ni.github.io/webvi-examples/ConnectWebVIToWebSocketEchoServer/) appears to utilize WSS to communicate with an echo server--- but there is no mention of TLS certs in the source code.

 

Please let me know if I'm missing something obvious, or please suggest alternate routes. Thanks.

0 Kudos
Message 1 of 2
(1,117 Views)

(Replying here instead of via email)

 

What is the error message you're seeing when you try to use wss? Browsers don't allow mixed-security any more - if the page is served via HTTPS then you must also use secure WebSockets (wss).

 

I am not sure exactly where NXG gets/loads its client certificates from - I suspect it's based on whatever web-rendering engine that NXG is using - I would expect that loading certificates into the OS store would work.

 

One way to check/test would be to build the WebVI and try to get it working in your browser of choice and see if you can load your certificate from there.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 2
(1,051 Views)