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
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
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
thanks for your help
It is working for me now.