Search code examples
sslopensslmqtttls1.2mosquitto

mosquitto_sub error. Error: Problem setting TLS options: File not found


I am using Windows 11.

I try to use SSL-TLS with Mosquitto Broker.

I have created the certificates correctly.

When try to run

mosquitto_sub -h 192.168.68.131 -p 8883 -t test --cafile /mosquitto/certs/ca.crt --tls-version tlsv1.2

It gives me

Error: Problem setting TLS options: File not found.

I already check the internet options to make tls versions enable. The question already on Stack Overflow but the answers not for Windows and are not accepted.


Solution

  • As Windows user you have to use paths in Windows style, not Linux style.

    Use something like --cafile "C:\Program Files (x86)\mosquitto\certs\ca.crt"

    Verify the path, but your command re-written would be:

    mosquitto_sub -h 192.168.68.131 -p 8883 -t test --cafile "C:\Program Files (x86)\mosquitto\certs\ca.crt" --tls-version tlsv1.2