New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mosquitto disconnect the client when subscribe is not authorized #1016
Comments
Could you provide some more details on the configuration you're using please? |
@ralight Thanks for your response. Its default configuration nothing changed in mosquitto.conf file I have just added auth data auth_plugin /home/ubuntu/mosquitto/go-auth.so auth package owner said its from mosquitto. |
auth packager said it's from mosquitto what? There's no go-auth.so package provided here at least. Are you sure the plugin is not crashing on something unexpected and that's causing it to drop things? |
@karlp https://github.com/jpmens/mosquitto-auth-plug mosquitto-go-auth issue: same result client disconnect when he try to subscribe to unauthorized topic. |
Testing with my own golang plugin: returning false from mosquitto_auth_acl_check when access flag is MOSQ_ACL_SUBSCRIBE will indeed result in "Socket error on client", but not when it's MOSQ_ACL_READ. Just tried with tag v1.5.3 |
Thanks for the description @ibrahimkoujar and for confirming @Daedaluz. This should now be fixed in the fixes branch, could you check and close the issue if it's working for you? |
Hello
The problem is when user try to connect to the broker its work normally but when he try to subscribe to unauthorized topic the package disconnecting the user socket from broker, its happened only with subscribe, publish works fine.
Backend log
mqtt client app
`
var mqtt = require('mqtt');
var mqttClient = mqtt.connect('mqtt:https://localhost:1883', {
username: "device_1",
password: "secret",
});
mqttClient.on('connect', function () {
mqttClient.subscribe("topic2");
console.log("App connected to MQTT Broker!");
});
`
p.s: same result in auth-plug and go-auth packages.
Thanks.
The text was updated successfully, but these errors were encountered: