Securing MQTT over WebSockets with TLS
So far, we have been working with MQTT over WebSockets without TLS. We can change the configuration and make simple edits to the code to work with MQTT over WebSockets with TLS and enable encrypted communications.
In Chapter 2, Securing an MQTT Mosquitto Server , we secured our Mosquitto server, and therefore, we can use the digital certificates we have created. However, it is very important to know that self-signed certificates require more steps to be installed as trusted certificates in the different operating systems that run the diverse web browsers that can use MQTT over WebSockets.
In this chapter, we saved the following files in a directory called certificates
. We will use these file names as a baseline for a sample configuration.
ca.crt
: Certificate authority certificate filedevice001.crt
: Client certificate filedevice001.key
: Client key
In order to work with WebSockets over TLS and enable encrypted communications, it is necessary to follow...