MQTT Client, SSL Authenticity error: ‘Authenticity is not established by certificate path validation’

Hello,
I don’t know for emqtt as I’ve not used it at all.
However, I see that there is a ssl_opts that you should use to give ssl indications to the underlying connection.
Here is a set of options I’m using to connect to amqps (param is ssl_options in amqp library), It is erlang ssl_options under the hood so this should give you a starting point.

...
 ssl_options: [
             versions: [:"tlsv1.3"],
             verify: :verify_peer,
             cacerts: :public_key.cacerts_get(),
             depth: 2,
             customize_hostname_check: [
               match_fun: :public_key.pkix_verify_hostname_match_fun(:https)
             ]
           ]
...

Cheers,
Sébastien.

1 Like