1 (edited by srikbn 2019-03-11 10:16:26)

Topic: Using WolfMQTT and Wolfssl connecting to AWS

Hi,
Am trying to connect from Embedded platform to AWS IOT MQTT broker
and getting below error

00> wolfSSL Leaving SendClientHello, return 0
00> connect state: CLIENT_HELLO_SENT
00> MQTT:I: Read 5 buffer size
00> ETHERNET:I: IOT_ATCMDDRV_uwTransmitCallback Transmit Completed
00> ETHERNET:I: Data not available
00> ETHERNET:I: IOT_ATCMDDRV_uwTransmitCallback Transmit Completed
00> ETHERNET:I: Read socket data size 5
00> MQTT:I: WolfMQTT Read Data Successfully
00> Cipher AES128-SHA:AES256-SHA:HC128-SHA:AES128-SHA256:AES256-SHA256:AES128-GCM-SHA256
00> growing input buffer
00>
00> MQTT:I: Read 5000 buffer size
00> ETHERNET:I: IOT_ATCMDDRV_uwTransmitCallback Transmit Completed
00> ETHERNET:I: Read socket data size 1024
00> MQTT:I: WolfMQTT Read Data Successfully
00> ETHERNET:I: IOT_ATCMDDRV_uwTransmitCallback Transmit Completed
00> ETHERNET:I: Read socket data size 1024
00> MQTT:I: WolfMQTT Read Data Successfully
00> ETHERNET:I: IOT_ATCMDDRV_uwTransmitCallback Transmit Completed
00> ETHERNET:I: Read socket data size 1024
00> MQTT:I: WolfMQTT Read Data Successfully
00> ETHERNET:I: IOT_ATCMDDRV_uwTransmitCallback Transmit Completed
00> ETHERNET:I: Read socket data size 1024
00> MQTT:I: WolfMQTT Read Data Successfully
00> ETHERNET:I: IOT_ATCMDDRV_uwTransmitCallback Transmit Completed
00> ETHERNET:I: Read socket data size 904
00> MQTT:I: WolfMQTT Read Data Successfully
00> Cipher AES128-SHA:AES256-SHA:HC128-SHA:AES128-SHA256:AES256-SHA256:AES128-GCM-SHA256
00> received record layer msg
00> wolfSSL Entering DoHandShakeMsg()
00> wolfSSL Entering DoHandShakeMsgType
00> processing server hello
00> wolfSSL Entering DoServerHello
00> wolfSSL Entering VerifyClientSuite
00> wolfSSL Leaving DoServerHello, return 0
00> wolfSSL Leaving DoHandShakeMsgType(), return 0
00> wolfSSL Leaving DoHandShakeMsg(), return 0
00> More messages in record
00> received record layer msg
00> wolfSSL Entering DoHandShakeMsg()
00> wolfSSL Entering DoHandShakeMsgType
00> processing certificate
00> wolfSSL Entering DoCertificate
00> wolfSSL Entering ProcessPeerCerts
00> Loading peer's cert chain
00> Put another cert into chain
00> wolfSSL Leaving ProcessPeerCerts, return -328
00> wolfSSL Leaving DoCertificate, return -328
00> wolfSSL Leaving DoHandShakeMsgType(), return -328
00> wolfSSL Leaving DoHandShakeMsg(), return -328
00> wolfSSL error occurred, error = -328
00> wolfSSL Entering SSL_get_error
00> wolfSSL Leaving SSL_get_error, return -328
00> wolfSSL Entering SSL_free
00> CTX ref count not 0 yet, no free
00> Shrinking input buffer
00>
00> wolfSSL Leaving SSL_free, return 0
00> wolfSSL Entering SSL_CTX_free
00> CTX ref count down to 0, doing full free
00> wolfSSL Entering wolfSSL_CertManagerFree
00> wolfSSL Leaving SSL_CTX_free, return 0
00> wolfSSL Entering wolfSSL_Cleanup
00> wolfSSL Entering wolfCrypt_Cleanup
00> ETHERNET:I: AT Command Sent: +++ ETHERNET:I: IOT_ATCMDDRV_uwTransmitCallback Transmit Completed
00> ETHERNET:I: AT Command Timeout
00> ERROR: Cannot Close Socket
00> ERROR: WolfMQTT Connection Close Failed
00> MQTT:I: MQTT Socket Connect:Error (Network) ret code -8
00> ERROR: WolfMQTT Connect Failed -8
00> wolfSSL Leaving DoHandShakeMsg(), return 0
00> More messages in record
00> received record layer msg
00> wolfSSL Entering DoHandShakeMsg()
00> wolfSSL Entering DoHandShakeMsgType
00> processing certificate
00> wolfSSL Entering DoCertificate
00> wolfSSL Entering ProcessPeerCerts
00> Loading peer's cert chain
00> Put another cert into chain
00> wolfSSL Leaving ProcessPeerCerts, return -328
00> wolfSSL Leaving DoCertificate, return -328
00> wolfSSL Leaving DoHandShakeMsgType(), return -328
00> wolfSSL Leaving DoHandShakeMsg(), return -328
00> wolfSSL error occurred, error = -328
00> wolfSSL Entering SSL_get_error
00> wolfSSL Leaving SSL_get_error, return -328
00> wolfSSL Entering SSL_free
00> CTX ref count not 0 yet, no free
00> Shrinking input buffer
00>
00> wolfSSL Leaving SSL_free, return 0
00> wolfSSL Entering SSL_CTX_free
00> CTX ref count down to 0, doing full free
00> wolfSSL Entering wolfSSL_CertManagerFree
00> wolfSSL Leaving SSL_CTX_free, return 0
00> wolfSSL Entering wolfSSL_Cleanup
00> wolfSSL Entering wolfCrypt_Cleanup
00> ETHERNET: AT Command Sent: +++ ETHERNET: IOT_ATCMDDRV_uwTransmitCallback Transmit Completed
00> ETHERNET:I: AT Command Timeout
00> ERROR: Cannot Close Socket
00> ERROR: WolfMQTT Connection Close Failed
00> MQTT:I: MQTT Socket Connect:Error (Network) ret code -8
00> ERROR: WolfMQTT Connect Failed -8

Share

2 (edited by Kaleb J. Himes 2019-03-12 15:12:12)

Re: Using WolfMQTT and Wolfssl connecting to AWS

Hi srikbn,

Can you capture a wireshark trace of the connection so we can see the certs coming back from the server? The -328 is a malformed buffer error indicating there is an issue with the cert. If you can capture a wireshark trace and send it to us we can check to see if the cert is corrupted in any way or if the cipher suite list (which is ONLY static cipher suites) is causing an issue with the cert chain in question.

Can you also send us the build options you are using?


- K