MQTT Broker: use Common Name (CN) from client certificate as username

When using certificate based encryption the client certificate can be used to retrieve the username. The benefit is, that the connecting device doesn’t require user-id / password. This increases security as the password isn’t stored remotely. There are two possible options available in Mosquitto:

  • use_identity_as_username [ true | false ]
  • use_subject_as_username [ true | false ]

Please allow in the configuration of the Mosquitto Broker to insert configuration items such as:

  • use_identity_as_username: true

Thank you
Adrian