I faced the same issue "Socket error on client , disconnecting." when my mosquitto configuration file contained this
allow_anonymous true
password_file /etc/mosquitto/passwd
The configuration file containing both lines seem to confuse the broker what to do. Fixed the issue when changing to
#password_file /etc/mosquitto/passwd
allow_anonymous true