How to Connect to a Server Using the WSS Protocol in LabVIEW

Updated Oct 26, 2026

Environment

Software

  • LabVIEW
  • WebSockets API

I can connect to my server using a client created with the WebSocket API. However, after upgrading the server to support secure connections (TLS), the client can no longer connect and returns the following error.

Error.png

Because version 2.1.0.40 of the third-party WebSockets API does not support TLS-enabled connections, servers configured for secure communications cannot properly respond to requests made by the API. The client may receive the following HTTP handshake response:

HTTP/1.1 400 Bad Request
Date:xx
Content-Type: text/html
Content-Length: xx
Connection: close
 
<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
</body>
</html>

 

Follow these steps to enable a TLS connection in LabVIEW:
  1. Use LabVIEW 2020 or later, which supports TLS functions.
  2. Enable the WebSocket API as described in the article How Do I Use WebSockets for Data Communication in LabVIEW?
  3. Replace the VI in the WebSocket API library with the VI of the same name included in the attachment.
  4. Run your application.