Using MQTT helper library for TLS

Hi,

in Cellular Iot Fundamentals there is in lesson 4 an exercise to move to MQTT with TLS.

As I used MQTT helper library, I wonder if it is enough to modify the structure

struct mqtt_helper_conn_params conn_params = {
.hostname = CONFIG_MQTT_BROKER_HOSTNAME,
.port = CONFIG_MQTT_BROKER_PORT,
.transport.type = MQTT_TRANSPORT_SECURE,
.transport.tls.sec_tag = CONFIG_MQTT_TLS_SEC_TAG,
.transport.tls.hostname = CONFIG_MQTT_BROKER_HOSTNAME,
.transport.tls.peer_verify = TLS_PEER_VERIFY_REQUIRED,
};
to have a secure connection , anyway providing certificate as described in the example.
Thanks in advance for reply 
Best Regards

Parents Reply
  • Hi.

    Sorry, I am trying to import code of v2.8.x-v2.7.0\l4\l4_e2_sol example in a cpp project but it neds the

    library for getaddrinfo, addrinfo,inet_ntop,freeaddrinfo.

    I have include the headers 

    #include <zephyr/kernel.h>

    #include <zephyr/net/socket.h>

    #include <zephyr/net/mqtt.h>
    like in the example but it looks like they are not declared in this header. So I wonder if they are implicitly
    loaded somewhere else.
    If I do not get compiled I cannot solve the problem of missing config.

    Thanks. Regards.
Children
Related