Hi everyone,
I am looking at using MQTT v3.1.1 with TLS 1.2, to send data to Azure IoT Hub.
I tested the MQTT Simple sample and it worked perfeclty. So I am modifying this project to enable TLS. To do so I followed those threads:
https://devzone.nordicsemi.com/f/nordic-q-a/44921/nrf9160-tls-and-mqtt
https://devzone.nordicsemi.com/f/nordic-q-a/49339/implementing-tls-with-mqtt-in-nrf9160
Right now I am able to create the TLS socket but I am stucked at the next step which is the connection step.
When defining tls_config->peer_verify = 2; I got back ERROR: mqtt_connect -45.
And when I define it to 0 or 1 there is no response, as if the nRF9160 is stucked somewhere.
My log is the following for peer_verify=2. It is the same for 0/1, but without the error code.
It has to be noted that the certificates I used are working in an application on my computer. They are placed here in certificates.h and are using the right formatting.
In my project folder, my prof.conf file is the following:
The Kconfig file there is the following:
And the main.c is :
Looking at errno.h, I understand the error -45 as "Operation not supported on socket".
But which operation is not supported ?
How can I fix this ? And why is it hanging out when I use peer-verify=0 or 1 ?
Thank you in advance