We’re migrating to MQTT for an offline network (zero internet access) and are trying to test TLS-PSK with username/password. We want to avoid setting up a CA for this offline network so we’re trying to use the TLS-PSK features.
We’re unable to get it working first in our lab. The docs seem pretty simple, but we’re clearly missing something. We followed the example in the tls-psk test itself.
If we disable PSK, the auth works fine on port 1883. So it’s not that issue. We cannot get a successful TLS-PSK connection to work with or without auth (username/password).
There is only one global listener and there is no firewall on the mqtt server in the lab yet. Meaning, everything is wide open on the same physical switch.
Pointers or advice?
The following is our lab config with throwaway values for psk and pwfile.
2022-09-08T16:52:51: mosquitto version 2.0.11 running
2022-09-08T16:53:33: New connection from ::1:49772 on port 8883.
2022-09-08T16:53:33: Client <unknown> disconnected due to protocol error.
We removed the default debian 11 bullseye mosquitto completely. Installed from the mosquitto repos. Now running 2.0.14 version.
same command line, same config. new error:
2022-09-09T14:22:33: mosquitto version 2.0.14 running
2022-09-09T14:24:00: New connection from ::1:50112 on port 8883.
2022-09-09T14:24:00: Client <unknown> disconnected due to malformed packet.
It seems MOSQ_ERR_MALFORMED_PACKET has more calls in the code. It’s unclear to us if the issue is in handle_connack.c, handle_publish.c, or somewhere else.