From the course: WebSocket Programming with Java EE

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

WebSocket encryption

WebSocket encryption

From the course: WebSocket Programming with Java EE

Start my 1-month free trial

WebSocket encryption

- [Instructor] Now let's see how to encrypt our WebSocket connection so that no one can snoop on our conversations. We need to make some configurations to the deployment descriptor, and change the URI endpoint in the JavaScript file that creates the client connection in the client application. I have opened here already the web.xml file, and in this file, we simply need to specify the transport guarantee as confidential. So, let's do that first. So, here in this location, we simply need to start specifying how to use the data constraints, and then we're gonna use the data constraint to specify it as confidential. And that's it. We now have an encrypted access to the rooms slash star URI. Now that the chat endpoint is encrypted, the protocol schema has changed from WS to WSS, and the port has changed to 8181, so you must change the service location URI in the WebSocket client JavaScript file in the webapp directories. So I have this open here already, and this is the URL we need to…

Contents