Community news, upcoming events and general discussions
Threads: 36 Posts: 88
Get technical support from the community
Threads: 1416 Posts: 7560
Threads: 18 Posts: 64
Tell us how to make XDK better!
Threads: 36 Posts: 119
Share and discuss community member projects
Threads: 78 Posts: 343
I try to setup TLS in MQTT transport. I set different options that were required :
- url of the mqtt server
- authentication with username and password
- certificatepath of the server
And a clientId with different topics. Before I set mqtts transport, all went fine. However, when I enable mqtts transport, XDK device cannot connect to mosquitto mqtt broker. A return code is sent in the console, but I do not know what that means.
Hello Jules Abadie,
Connection to MQTT broker has failed with error code RC_UNSUPPORTED_SCHEME(398) from Servalstack. Can you check the following,
The broker is running on a Raspberry on localhost. The XDK device go through the Wi-Fi to then access to the Raspberry on the localhost address. The certificate of the server is correct from my point of view. I generated it with openssl command, and I checked few features :
- The common name (CN) : where I put the raspberry's address through the Wi-Fi that I use for the project. (The CN of the CA is different from the broker)
- The validation date is good
I guess that the server is secured, a simple authentication is set with the default profile. But I do not think it is the problem.
Also when I tried a local TLS communication between 'mosquitto_sub' and 'mosquitto_pub' command, it works, as : (I disable certificate authentication)
mosquitto_sub -d -h 192.168.10.20 -p 8883 -t Hello --cafile /etc/mosquitto/ca_certificates/ca.crt -u julio -P julio*
mosquitto_pub -d -h 192.168.10.20 -p 8883 -t Hello --cafile /etc/mosquitto/ca_certificates/ca.crt -u julio -P julio* -m 'Hey'
The subscriber see the response : Hey
I did find my problem on MQTTS setup. It was on the broker configuration, where the TLS version was important. The only version that works is TLS v.1.2. Now for me, the MQTTS dialog between XDK device and the broker via Wi-Fi works fine.