Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. 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
    languagebash
    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
    languagebash
    mqtt subscribe --topic # --jsonOutput \
      --hostname example.domain.com --port 8883 \
      --cafile server.pem

  2. Error: Unable to connect. Reason: 'No name matching localhost found'

    Code Block
    languagebash
    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).

...