Forums - Aws mqtt-connect issue in qca4020

4 posts / 0 new
Last post
Aws mqtt-connect issue in qca4020
gecloudtest
Join Date: 29 May 18
Posts: 9
Posted: Mon, 2018-11-12 09:24

Hi,

I am trying to connect qca 4020 with aws cloud.

I am getting -28 error code (tls handshake timeout).
After dig deep into it , we got to know that , we have to set ALPN to x-amzn-mqtt-ca.

I am setting this configuration as below

if(qapi_Net_SSL_ALPN_Protocol_Add(pNetwork->tlsDataParams.sslCtx, "x-amzn-mqtt_ca"))
{
IOT_DEBUG("Error: ALPN Protocol add failed\n");
status =
NETWORK_SSL_UNKNOWN_ERROR;
goto error;
}

// Create SSL connection object
pNetwork->tlsDataParams.ssl = qapi_Net_SSL_Con_New(pNetwork->tlsDataParams.sslCtx,QAPI_NET_SSL_TLS_E);

Is this correct way to set the alpn?

Following function is returning timeout

/*SSL handshake with server*/
result = qapi_Net_SSL_Connect(pNetwork->tlsDataParams.ssl);

Can anyone suggest how can I configure the timeout or how can I set this alpn ?

Any help will be greatly appreciated

Thanks in advance,
Sushmita

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Mon, 2018-11-12 16:02

Kindly refer to section "6.3.6.13 SSL" from document "QCA402 (CDB2x) Development Kit User Guide"

Example code for "ssl config" is available in [target]quartz/demo/QCLI_demo/src/net/ssl_demo.c

  • Up0
  • Down0
ss.pandiri
Join Date: 29 May 18
Posts: 58
Posted: Mon, 2018-11-12 23:37

Dear Sushmitha,

In your code above, there's a minor issue:

Please change "x-amzn-mqtt_ca" to "x-amzn-mqtt-ca" (use hyphen in place of underscore). This is needed to connect  to AWSIoT 3.1.1.

if(qapi_Net_SSL_ALPN_Protocol_Add(pNetwork->tlsDataParams.sslCtx, "x-amzn-mqtt-ca"))
{
IOT_DEBUG("Error: ALPN Protocol add failed\n");
status =
NETWORK_SSL_UNKNOWN_ERROR;
goto error;
}

Also, QCA SDK needs to be updated with this change for benefit of AWSIoT 3.1.1  users

best regards

 

  • Up0
  • Down0
gecloudtest
Join Date: 29 May 18
Posts: 9
Posted: Tue, 2018-11-13 04:30

thanks for your help 

It is working for me now.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.