Configuration of external MQTT server - Failed to connect

When setting Broker options in HA 2024.9.2

  • Please enter the connection information of your MQTT broker.
    Next yields modal ‘Failed to connect’

When using ‘mosquitto_sub’ from the HA core shell it connects and returns as expected.

In the external mosquitto server logs I see the following error

1726644755: New connection from <mqtt-server-address>:55299 on port 8883
1726644755: OpenSSL Error[0]: error:0A00010B:SSL routines::wrong version number
1726644755: Client <unknown> disconnected: Protocol error.

Any ideas. Only started happening following an update from HA 2023.x.x

Port 8883? Usually 1883: are you sure that’s not a configuration error?

Thanks for your reply - no that is correct SSL port for MQTT

1 Like

If your previous HA installation was from last year, the logical question to ask is this:

How long has it been since you updated MQTT? wrong version number seems to indicate that it’s been a while.

I can see from my backups that the prior HA version was actually 2022.10.5.

My mosquitto version supports the asserted and selectable option in the HA MQTT configuration option which is 3.1.1

mosquitto version 2.0.11
mosquitto is an MQTT v5.0/v3.1.1/v3.1 broker.

The weird thing is the fact that I can open the HA terminal on core and execute a successful mosquitto_sub command to my external MQTT server.

Version 2.0.11 is ancient. Current version on mine is 6.4.1

Might be time to update your addon first, then take it from there.

is the version of the add-on, not the version of the included mosquitto. That is 2.0.18

And it seems more a wrong version number of OpenSSL

1 Like

Just to be clear - I’m connecting to an external MQTT Server, not an addOn.

The external MQTT server is installed by brew on OS X and is the recent (2.0.11) but not the absolute latest (which is 2.0.18).

No idea how this fixed it self but what i did was to

  1. Restore the backup for the 2022.10.5 backup which didn’t fix the problem
  2. Update again to the latest HA version
  3. Wait a day while the Settings::Devices and Integrations spun forever
  4. After many restarts of host and container

Finally working. No idea how this fixed itself. Taken me a week off-line to finally get my home running again :frowning: