Hmm. It's also failing in the same way when I try this rather benign textbook example, with standard username/password authentication and no TLS.
Something seems to be very wrong on my server, but what? I'm using 1.4.15-2ubuntu0.1 amd64.
root@web01:/etc/mosquitto# cat passwd
Roger:$6$BwKxtlSqxegGlU+l$9NZzsHu3M0ae5wMAoMWnD8zdRjsSfiDXCB1dLLuHKv5iK8uFAzOm/GF+j9V1k+GFFBlMgmWtdBY2Kcj4IdTcxw==
slowbro:$6$kDHuQ2u9jH1msxII$J/9z7d+1j3EoH/L06Qd3tSz4Ng7RWNRWwex0HduuGHlEyBGdW3cyF+lTx2F3d3o6IiLLwJzR5EMBiHrT4ACCbg==
root@web01:/etc/mosquitto# cat mosquitto.conf
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
allow_anonymous false
include_dir /etc/mosquitto/conf.d
root@web01:/etc/mosquitto# cat acls.txt
user Roger
topic readwrite house/P1/#
#Client settings
pattern readwrite house/%C/#
root@web01:/etc/mosquitto# cat conf.d/acl.conf
acl_file /etc/mosquitto/acls.txt
root@web01:/etc/mosquitto# cat conf.d/authentication.conf
password_file /etc/mosquitto/passwd
root@web01:/etc/mosquitto# cat conf.d/tls.conf
#cafile /etc/mosquitto/ca_certificates/ca.crt
#keyfile /etc/mosquitto/certs/server.key
#certfile /etc/mosquitto/certs/server.crt
#tls_version tlsv1.2
port 8883
#require_certificate true
#use_identity_as_username false
root@web01:/etc/mosquitto#
root@web01:~# mosquitto_sub --host
mqtt01.example.com --port 8883 --username 'slowbro' --pw 'secret' --topic "house/testing/test" --id testing --debug --qos 1 --verbose
Client testing sending CONNECT
Client testing sending CONNECT
Client testing sending CONNECT
^C
root@web01:~# mosquitto_sub --host
mqtt01.example.com --port 8883 --username 'Roger' --pw 'secret' --topic "house/P1/test" --id testing --debug --qos 1 --verbose
Client testing sending CONNECT
Client testing received CONNACK
Client testing sending SUBSCRIBE (Mid: 1, Topic: house/P1/test, QoS: 1)
Client testing received SUBACK
Subscribed (mid: 1): 1
Client testing received PUBLISH (d0, q1, r1, m1, 'house/P1/test', ... (13 bytes))
Client testing sending PUBACK (Mid: 1)
house/P1/test Testing 1 2 3
^C
root@web01:~#
Feb 16 22:06:08 web01 mosquitto[29660]: mosquitto version 1.4.15 (build date Wed, 13 Feb 2019 00:27:01 +0000) starting
Feb 16 22:06:08 web01 mosquitto[29660]: Config loaded from /etc/mosquitto/mosquitto.conf.
Feb 16 22:06:08 web01 mosquitto[29660]: Opening ipv4 listen socket on port 8883.
Feb 16 22:06:08 web01 mosquitto[29660]: Opening ipv6 listen socket on port 8883.
Feb 16 22:06:30 web01 mosquitto[29660]: New connection from 127.0.0.1 on port 8883.
Feb 16 22:06:30 web01 mosquitto[29660]: Socket error on client <unknown>, disconnecting.
Feb 16 22:06:31 web01 mosquitto[29660]: New connection from 127.0.0.1 on port 8883.
Feb 16 22:06:31 web01 mosquitto[29660]: Socket error on client <unknown>, disconnecting.
Feb 16 22:06:32 web01 mosquitto[29660]: New connection from 127.0.0.1 on port 8883.
Feb 16 22:06:32 web01 mosquitto[29660]: Socket error on client <unknown>, disconnecting.
Feb 16 22:07:48 web01 mosquitto[29660]: New connection from 127.0.0.1 on port 8883.
Feb 16 22:07:48 web01 mosquitto[29660]: New client connected from 127.0.0.1 as testing (c1, k60, u'Roger').
Feb 16 22:07:48 web01 mosquitto[29660]: Sending CONNACK to testing (0, 0)
Feb 16 22:07:48 web01 mosquitto[29660]: Received SUBSCRIBE from testing
Feb 16 22:07:48 web01 mosquitto[29660]: #011house/P1/test (QoS 1)
Feb 16 22:07:48 web01 mosquitto[29660]: testing 1 house/P1/test
Feb 16 22:07:48 web01 mosquitto[29660]: Sending SUBACK to testing
Feb 16 22:07:48 web01 mosquitto[29660]: Sending PUBLISH to testing (d0, q1, r1, m1, 'house/P1/test', ... (13 bytes))
Feb 16 22:07:48 web01 mosquitto[29660]: Received PUBACK from testing (Mid: 1)
Feb 16 22:07:49 web01 mosquitto[29660]: Socket error on client testing, disconnecting.