You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried 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.
As the password seems to be incorrect. In fact it isn't but it seems that the space inside of the pw breaks the parsing from the mosquitto config file which in the end transfers a wrong pw to the Azure Broker.
I am forced to use a password containing a space for Azure IoT as it is auto generated. There is no way to enclose the password inside of the bridge configuration file.
And an excerpt from the root cause as found by Mikkel:
...
Thanks for the report, this error only affects the bridge configuration parameters, I presume because I didn't migrate them to use the "parse string" function because the error string was a different pattern.
Migrated from https://bugs.eclipse.org/bugs/show_bug.cgi?id=492694
My question was posted on the mailing list and Mikkel Kirkgaard Nielsen digged into to it to find the real bug, he deserves the credit.
Original Post: https://dev.eclipse.org/mhonarc/lists/mosquitto-dev/msg01086.html
I tried 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.
As the password seems to be incorrect. In fact it isn't but it seems that the space inside of the pw breaks the parsing from the mosquitto config file which in the end transfers a wrong pw to the Azure Broker.
I am forced to use a password containing a space for Azure IoT as it is auto generated. There is no way to enclose the password inside of the bridge configuration file.
And an excerpt from the root cause as found by Mikkel:
...
The space will give you trouble as the code of src/conf.c line 1536
(http:https://git.eclipse.org/c/mosquitto/org.eclipse.mosquitto.git/tree/src/conf.c?h=v1.4.7#n1536)
will parse only until the first space after "remote_password", so that
is a no-go.
token = strtok_r(NULL, " ", &saveptr);
...
below is my bridge config.
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
The connection through mosquitto_pub worked fine:
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
Thanks in advance.
Regards,
The text was updated successfully, but these errors were encountered: