moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 508 forks source link

SSL/TLS Certificate confusion between Client and Broker #673

Closed harishydav closed 7 years ago

harishydav commented 7 years ago

I am trying to setup a Mosca server with SSL/TLS encryption. Looking at the Mosca wiki at the page https://github.com/mcollina/mosca/wiki/TLS-SSL-Configuration suggests that we will require a private key and a certificate for the broker. While that page is silent about the the configuration on the client side for the mqtt over SSL/TLS, I found an article by Mattino Collina himself on SSL/TLS configuration on the client side. Here http://www.hivemq.com/blog/mqtt-client-library-mqtt-js This article states that for mqtts we need to provide a key and a certificate on the client side too. Should they be the same key and certificate that we provided while setting up the broker or different for every client that we connect to the broker? Are these keys and certificates a way of authenticating the client for the broker?

mcollina commented 7 years ago

They should never be the same. It depends on how you plan to authorize your devices.