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.
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
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.
remote_password SharedAccessSignature sr=foobar.azure-devices.net%2fdevices%2ftest&sig=CHANGEME2bN06SOMEMORECHARS%2bsA%3d&se=123456789
topic # out 0 events/ devices/test/messages/events/
Thanks in advance.
Bridge config parameters can now contain a space
Thanks to Sebastian Koch and Mikkel Kirkgaard Nielsen.
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.
You're welcome, this must approximate the definition of a quick fix ;).
Hope Sebastian is able to build it.