Hello everyone,
i am currently trying to bridge my local mosquitto topics into the Azure IoT topics with a bridge configuration. The Azure Broker bridge connection throws a:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Client test sending CONNECT
Client test received CONNACK
Connection Refused: not authorised.
Error: The connection was refused.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
and i suspect that this is caused by the space in the password that i defined in my bridge configuration. Unfortunately microsoft generates these password (SAS Tokens) automatically so i have no way to avoid the space. I tried setting the remote_password
parameter enclosing it into “” but this of course gave me a config error. I tried to escape the space with a “\” and i also tried using the encoding with %20 istead of the space. Neither worked.
This is the config (my DeviceID is “test”):
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
connection bridge-SC-to-AzureIoT
address skoch-test01.azure-devices.net:8883
cleansession false
start_type automatic
clientid test
remote_username skoch-test01.azure-devices.net/test
remote_password SharedAccessSignature sr=foobar.azure-devices.net%2fdevices%2ftest&sig=CHANGEME2bN06SOMEMORECHARS%2bsA%3d&se=123456789
bridge_insecure false
bridge_protocol_version mqttv311
bridge_capath /etc/ssl/certs
bridge_tls_version tlsv1
notifications false
try_private false
topic # out 0 events/ devices/test/messages/events/
log_dest stdout
log_type debug
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note: i successfully connected to the azure broker via mosquitto_pub where the password is passed as parameter –P enclosed in “”.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
mosquitto_pub -d -h skoch-test01.azure-devices.net -p 8883 -u "skoch-test01.azure-devices.net/test" -P "SharedAccessSignature sr=foobar.azure-devices.net%2fdevices%2ftest&sig=CHANGEME2bN06SOMEMORECHARS%2bsA%3d&se=123456789" -i test -m "{\"deviceName\":\"Device1\",\"foobar_lol\":10.980438438244164}"
-t "devices/test/messages/events/" --tls-version tlsv1 -V mqttv311 --capath /etc/ssl/certs
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is my question: Is there any way to work around this issue (if it is the issue) - does anyone know how the password is parsed from the config file by mosquitto, is the space the problem here?
Thanks in advance for your help.
Sebastian