MQTT Security
Answer
9/3/18 9:32 PM

Hi everyone,

I am trying to add security to MQTT in the new version of XDK Workbench. Before I can add username and passwords so that XDK can use this way to connect to MQTT broker. But now it requires server certificate authentication. Then it requires HTTPs server certificates. But I want to use my local MQTT broker. Is it possible?

And I also try to use SSL/TLS to connect to MQTT broker like AWS. Now I am using mosquito and I added ca.crt, server.crt and server.key to MQTT broker. When I choose MQTT_TYPE_AWS it can connect. So is it possible to use this way?

Thany you at first

0 (0 Votes)
RE: MQTT Security
Answer
9/4/18 3:26 PM as a reply to Rachel Wu.
Hello Rachel,

Unfortunately, I struggle to follow your exact use case. Therefore, a few questions:

You are trying to set up a secured MQTT client on the XDK, to connect to your own MQTT broker?
If this is the case, you would have to flash the into .der files converted certificates, into the flash memory of the XDKs Wi-Fi chip.

If you are using AWS to connect the XDK to your own broker and it works fine, you can proceed with it.

Additionally, in regards of setting a username and password, the Serval MQTT and also AWS MQTT implementation, unfortunately, do not integrate the functionality to add a username and password yet. To solve this, you would have to add a third party lib, such as MQTT paho to your XDK application and use it instead of the Serval MQTT or AWS MQTT implementation.

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Votes)
RE: MQTT Security
Answer
9/5/18 6:51 AM as a reply to Franjo Stjepandic.

Hello Rachel,

to connect to MQTT with username and password try following application:

https://github.com/xdk2mam/xdk2mam/tree/master/mqtt/xdk2mam-c

This is used for the XDK2MAM project to transmit the XDK Sensor values to the IOTA Tangle, a distributed ledger tecnology (DLT).

The part I linked above is the repo to the XDK code to setup the MQTT connection with the XDK.

Cheers,
Antonio

0 (0 Votes)
RE: MQTT Security
Answer
9/5/18 2:17 PM as a reply to Antonio Nardella.
Hello Antonio,

Thank you for the hint about how to add a username and a password.

After the first glance at XDK2MAM, it looks really promising.

That seems definitely worth the try for Rachel’s project.

Kind regards,
Franjo
0 (0 Votes)