Hello everyone,
I am trying to connect my BG95-M2 to Azure IoT Hub.
I followed the “Example of MQTT Operation with SSL”, and cannot open the TCP_context linked to my SSL_Context. Every time I tried to Open my TCP context, I got back +QMTOPEN: 0,-1
.
My certifcates and keys are working when I connect to Azure IoT Hub via my computer, and the files within the BG95-M2 have no issue.
Here is my log (I did not add the AT+QFUPL commands as the .pem are already in the storage):
[2020-02-17 15:54:05:065_S:] AT+QMTCFG="ssl",1,1,2
[2020-02-17 15:54:05:081_R:] OK
[2020-02-17 15:54:13:737_S:] AT+QSSLCFG="cacert",2,"cacert.pem"
[2020-02-17 15:54:13:752_R:] OK
[2020-02-17 15:54:19:479_S:] AT+QSSLCFG="clientcert",2,"client.pem"
[2020-02-17 15:54:19:479_R:] OK
[2020-02-17 15:54:25:709_S:] AT+QSSLCFG="clientkey",2,"user_key.pem"
[2020-02-17 15:54:25:725_R:] OK
[2020-02-17 15:54:33:949_S:] AT+QSSLCFG="seclevel",2,2
[2020-02-17 15:54:33:964_R:] OK
[2020-02-17 15:54:39:272_S:] AT+QSSLCFG="sslversion",2,4
[2020-02-17 15:54:39:272_R:] OK
[2020-02-17 15:54:44:362_S:] AT+QSSLCFG="ciphersuite",2,0XFFFF
[2020-02-17 15:54:44:378_R:] OK
[2020-02-17 15:54:50:681_S:] AT+QSSLCFG="ignorelocaltime",2,1
[2020-02-17 15:54:50:696_R:] OK
[2020-02-17 15:55:00:468_S:] AT+QMTOPEN=1,"14.95.15.251",8883
[2020-02-17 15:55:00:483_R:] OK
[2020-02-17 15:55:03:346_R:] DSR:0 CTS:1 (RI:1) DCD:0
[2020-02-17 15:55:03:362_R:] +QMTOPEN: 1,-1
[2020-02-17 15:55:03:479_R:] DSR:0 CTS:1 (RI:0) DCD:0
I suppose there is something wrong with my SSL configuration as I can open a TCP port when I enable SSL and do not change the default configuration (obviously I can’t connect after that).
This Azure documentation tells us that we can use the MQTT protocol directly. Is it possible to use this and not the CA certificates to connect to Azure with the BG95-M2 ?
I tried it anyway but I am stuck at the connection step, where I got back +QMSTAT:2,3
.
Thanks in advance,
Thomas