It seems the latest cerbo firmware (3.52) only supports SSL connections for MQTT. Plain text is no longer an option that is shown in the configuration menu.That means your second option was not available for me. I only started to set up MQTT after I had updated the cerbo to the latest firmware.
I can’t completely test your scenario since my HA is container based, and I run a separate mosquitto broker. That one has no problem with the bridge connection, with
bridge_insecure true
and using the certificate I extracted from the cerbo with the command I gave in my previous reply. I only gave the bridge_cafile. No need to specify a bridge_capath if the file is fully specified.
I don’t know why the in-built Mosquitto in HA would not work the same way, unless they used different compile options and the bridge_insecure is ignored. Seems unlikely.
I’ve tried your steps to get the certificate and this works! It seems that the only difference was the certificate/cafile - I previously extracted the certificate as whole chain, tried different methods (openssl, download it from browser etc.).
I don’t understand why, but extracting the certificate using your openssl options resulted in slightly different certificate than I got previously (I compared them carefully), and putting it into config as ca_file works.
I did not complete the whole integration with HA, just checked if the values are coming to HA, and it works, and Mosquitto shows successfull connection using bridge in the log.
Not sure if this will persist until further Victron updates, if the certificate changes, but now it shows it expires in 2123, so hopefully it won’t change
Thanks milion times! Now I can finally play with the HA integration! :-
Change the file attributes to 700 since it contains your CF token and it must be executable.
Run the cert.sh file: $> ./cert.sh
You should see some details of the running acme.sh script.
Notes: You can add the script to the rc.local file in /data (/data/rc.local) to make sure it runs at every reboot. I haven’t spend time debugging, it seems that acme.sh can’t configure the crontab on installation, something to look into…
The ‘sleep’ command is to wait 30 seconds if the script is used at boot, it waits to have Internet. Safely remove it as needed.
Technically once you have created your certificate, you don’t need the cron.sh. I used this option to make sure acme.sh is installed and if not, install it. You can simply use the cron command since all the keys and domains are now stored in .acme.sh.
To renew, simply run: