Adding an eternal MQTT broker via TLS

Hello, I’m trying to add an existing external MQTT broker (Mosquitto) to HA. I’m using a self-signed certificate running on port 8883. I consider using a self-signed certificate better than not using any certificate, and I prefer to continue doing it this way. I can connect to my MQTT broker using other clients, but when trying to connect in Home Assistant, the Mosquitto log shows:

Client connection from IP_address failed: error:0A00010B:SSL routines::wrong version number.

Researching this seems to indicate that HA is trying to connect to the MQTT broker not using a secure TLS connection. My MQTT broker (Mosquitto) config:

allow_anonymous false
persistence true
password_file /etc/mosquitto/pwfile
listener 8883
cafile /etc/mosquitto/certs/mosquitto.crt
certfile /etc/mosquitto/certs/mosquitto.crt
keyfile /etc/mosquitto/certs/mosquitto.key
require_certificate false

I can’t find any option in the Home Assistant UI to explicitly specify TLS. I did enable Advanced mode, and I enabled the Advanced settings in the MQTT setup dialog and enabled the option to “Ignore broker certificate validation.”

The HA log just shows:

Logger: paho.mqtt.client
Source: /usr/local/lib/python3.13/site-packages/paho/mqtt/client.py:3259
First occurred: 3:57:43 PM (4 occurrences)
Last logged: 4:26:58 PM

failed to receive on socket: [Errno 104] Connection reset by peer

Any suggestions would be greatly appreciated. Thank you!

I was finally able to get this working by selecting “Custom” for “Broker Certificate Validation.” Then, upload the .crt file from the existing external MQTT broker.