Mosquitto Auth Wildcard topic not working

Hi @iegomez

Basically the errors were about dependencies versions.
I managed to install Go 1.12.7 and compile it.

Now I’m dealing with MongoDB backend.

I’m getting this error:

time=“2019-09-03T16:29:36Z” level=debug msg=“checking auth cache for user1”
time=“2019-09-03T16:29:36Z” level=debug msg=“checking user user1 with backend Mongo”
time=“2019-09-03T16:30:06Z” level=debug msg=“Mongo get user error: server selection error: server selection timeout\ncurrent topology: Type: ReplicaSetNoPrimary\nServers:\nAddr: localhost:27017, Type: Unknown, State: Connected, Avergage RTT: 0, Last error: dial tcp 127.0.0.1:27017: connect: connection refused\n”

Even though my parameters are all corrects, I’ve placed a debug on source code mongo.go and got:

time=“2019-09-03T16:29:35Z” level=debug msg=“Host: ip-XXX-XX-XX-XXX.sa-east-1.compute.internal”
time=“2019-09-03T16:29:35Z” level=debug msg=“Port: 27017”
time=“2019-09-03T16:29:35Z” level=debug msg=“Username: mqtt”
time=“2019-09-03T16:29:35Z” level=debug msg=“Password: mqtt123*”
time=“2019-09-03T16:29:35Z” level=debug msg=“DBName: iotBackend”
time=“2019-09-03T16:29:35Z” level=debug msg=“UsersCollection: mqttusers”
time=“2019-09-03T16:29:35Z” level=debug msg="AclsCollection: "

Maybe a relevant information, my Mongo Server isn’t on localhost, but in another VPS on same network and firewall rules are tuned.

if I try connecting to the same database using same credentials in command line I’m getting no problems:

ubuntu@ip-XXX-XX-XX-XXX:~/mosquitto-go-auth$ mongo mongodb://mqtt:mqtt123*@ip-XXX-XX-XX-XXX.sa-east-1.compute.internal:27017/iotBackend
MongoDB shell version v3.6.3
connecting to: mongodb://ip-XXX-XX-XX-XXX.sa-east-1.compute.internal:27017/iotBackend
MongoDB server version: 4.0.11
WARNING: shell and server versions do not match
MongoDB Enterprise rs0:PRIMARY>

The collection mqttusers exists but not acl collection.

Any hint to solve it ?

Thanks