Reputation: 668
We are developing a Mosquitto broker based POC where 3 different MQTT client being used i.e. C, Python and phpMQTT and we need to pass messages between these clients. But phpMQTT client does not implement SSL/TLS which is limiting us to enable SSL for the whole solution.
Is there any way to communicate between these three clients if my C & Python client are connected to the Broker on a secure port i.e. 8883( with TLS option enabled) and my phpMQTT client on port 1883(without TLS option) ?
Upvotes: 1
Views: 1601
Reputation: 11618
Mosquitto allows you to listen on as many ports as you wish. You can decide whether to support TLS on each listener. For example you could have port 1883 for unencrypted connections, port 8883 for regular certificate based TLS, port 8884 for certificate based TLS that requires clients to pass a valid certificate and port 8885 for TLS-PSK based encryption.
Aside from the encryption in use, clients connected to the broker would interact exactly the same as normal.
Upvotes: 1
Reputation: 5790
I'm not sure if mosquitto is able to start on two different ports. You could try to do this with HiveMQ, which supports a so called "hybrid mode" (http://www.hivemq.com/docs/hivemq/1.4.1/#hybrid-mode-chapter) This Hybrid mode lets you connect without TLS on any port (like 1883) and with TLS on another port (like 8883).
I'm not sure why you are using phpMQTT, but would websockets be an option for you? HiveMQ supports secure websockets out of the box, so you could give this a try. A blog post about how to do this is available here: http://www.hivemq.com/build-javascript-mqtt-web-application/
Disclaimer: I am one of the developers of HiveMQ
Upvotes: 0