...
Error: 'No subject alternative names present'
Meaning: the server CA file, supplied by to the client, contains CN that is not the same as the--hostname
Example command:Code Block language bash mqtt subscribe --topic # --jsonOutput \ --hostname 127.0.0.1 --port 8883 \ --cafile server.pem
Code Block Unable to connect. Reason: 'No subject alternative names present'
Reason: When the server.pem has CN that is not the IP address. For example, the server certificate has CN “example.domain.com”.
Workaround: On the client machine, edit the/etc/hosts
and append<ip-address> example.domain.com
. This way you can use the command successfully:Code Block language bash mqtt subscribe --topic # --jsonOutput \ --hostname example.domain.com --port 8883 \ --cafile server.pem
Error: Unable to connect. Reason: 'No name matching localhost found'
Code Block language bash mqtt subscribe --topic # --jsonOutput \ --host somehost --port 8883 \ --cafile server.pem
Code Block Unable to connect. Reason: 'No name matching localhost found'
Reason: the
--hostname
does not match the CN of the server.pem
Solution: Open the server.pem with a certificate viewer and find out the correct CN (hostname).
\uD83D\uDCCB Related articles
...