Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Mqtt Client SSL/TLS configuration

Mqtt Client SSL/TLS configuration

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fabel84
    wrote on 5 Apr 2018, 13:16 last edited by
    #1

    Hi all,
    I've installed a mosquitto broker on a server and now I'm developing an application running on IOS and Android that contains a mqtt client. For this purpose I'm using QtMqtt module and now all work fine without security. Now I want to introduce TLS, but I'm not able to configure correctly the client.

    I've not to specify the certificate, but the sslPeerName(what is it?) to connect to the broker. How can I do? Any suggestion would be appreciated.

    Thanks

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Pablo J. Rogina
      wrote on 5 Apr 2018, 15:53 last edited by
      #2

      @Fabel84 not having used the module myself, from the same blog you refer it looks like you need to use method connectToHostEncrypted() "which behaves similar to QSslSocket‘s argument list" and it requires a sslPeerName argument as you mention. From QSslSocket::connectToHostEncrypted() documentation:

      this method enables the usage of a different hostname (sslPeerName) for the certificate validation instead of the one used for the TCP connection (hostName)

      so you provide the name of your peer (in this case the MQTT broker) that you expected the TLS handshake to validate.

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1

      2/2

      5 Apr 2018, 15:53

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved