My server host name is host1.mailhub4u.com and I am self-hosting a Debian 12 machine. I have been running the Mosquitto MQTT broker, the Exim4 mail server and the Apache2 web server for several years without a problem with PositiveSSL certificates that I have been manually generating and installing. I recently installed certbot and converted Exim4 and Apache2 to Letsencrypt certificates. Everything worked great and, quite frankly, was easily installed and made operational. Great!!!
Now, I am attempting to get Mosquitto to work with Letsencrypt, however, I have not yet been successfull. I executed all of the command line commands necessary to install the Letsencrypt certificates using certbot in order to get Apache and Exim working. I then have been endeavoring to use the same certificates for Mosquitto. The Letsencrypt certs are in the /etc/letsencrypt/live/host1.mailhub4u.com/ directory and are named:
cert.pem
chain.pem
fullchain.pem
privkey.pem
However, I am not certain which of these certificates should be assigned to which Mosquitto variables that are defined in /etc/mosquitto/conf.d/myconfig.conf as follows:
cafile
certfile
keyfile
I have tried to infer the proper relationship between the Mosquitto variables and the Letsencrypt certificates (based on my Apache2 and Exim4 configs) and I think that I have tried just about all the possible combinations with the four certificates and the three variables, however, so far, I have been unable to get it to work. The Mosquitto service starts properly without errors but then as soon as anybody connects to the Mosquitto MQTT server then it does not produce the MQTT feed and the following error shows up in the Mosquitto logs:
OpenSSL Error[0]: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca
To me this seems like a simple problem with the Letsencrypt certificates' configuration for Mosquitto that I should be able to figure out, however, so far I have not been successfull.
What are the correct Letsencrypt certificate names to be assigned to the Mosquitto variables, cafile, certfile and keyfile?
Does anybody have any suggestions on how to get Letsencrypt working with Mosquitto?
Please let me know if you do.
I use the Mosquitto broker on one of my weather websites for updating user's weather data in real time without the user having to refresh the page. The weather website can be viewed at:
https://crabapple.dickens.com/
I now need to convert the Mosquitto config back to the PositiveSSL certs so that my MTTQ broker feed works for my users while I figure this out. I say that so that if anybody tries to test my MQTT broker on my server it wiil be working because I have reverted to the PositiveSSL certificates. I can reimplement the Letsencrypt config whenever anyone wants to help test. Just let me know.
Thanks in advance for any recommendations.
Thanks,
Gordon