AWS IDT MQTT case, got unexpected alert message, mbedtls returned -0x7880

Thank you for taking time to report it.

Hi @aggarg @jun.luo
I am facing the same issue.i am not be able to connect with MQTT. it is throwing MQTTRecvFailed error.I observe the TLS logs and getting the same error,mbedtls_ssl_handle_message_type() returned -30848 (-0x7880).I am attaching the log here.

0x20026f68: => write

0x20026f68: => write record

0x20026f68: => encrypt buf

0x20026f68: dumping 'before encrypt: output payload' (20 bytes)

0x20026f68: 0000:  10 12 00 04 4d 51 54 54 04 02 00 3c 00 06 47 65  ....MQTT...<..Ge

0x20026f68: 0010:  6d 69 6e 69                                      mini

0x20026f68: dumping 'IV used (internal)' (12 bytes)

0x20026f68: 0000:  cf 16 54 e4 00 00 00 00 00 00 00 01              ..T.........

0x20026f68: dumping 'IV used (transmitted)' (8 bytes)

0x20026f68: 0000:  00 00 00 00 00 00 00 01                          ........

0x20026f68: dumping 'additional data used for AEAD' (13 bytes)

0x20026f68: 0000:  00 00 00 00 00 00 00 01 17 03 03 00 14           .............

0x20026f68: before encrypt: msglen = 20, including 0 bytes of padding

0x20026f68: dumping 'after encrypt: tag' (16 bytes)

0x20026f68: 0000:  56 cb 82 21 8d 90 e6 30 9b bc 79 d9 f2 6c 11 d2  V..!...0..y..l..

0x20026f68: <= encrypt buf

0x20026f68: output record: msgtype = 23, version = [3:3], msglen = 44

0x20026f68: dumping 'output record sent to network' (49 bytes)
0x20026f68: 0000:  17 03 03 00 2c 00 00 00 00 00 00 00 01 76 f0 22  ....,........v."

0x20026f68: 0010:  47 7f 20 53 3e e9 72 18 b6 d6 53 e2 aa c2 31 ca  G. S>.r...S...1.

0x20026f68: 0020:  ed 56 cb 82 21 8d 90 e6 30 9b bc 79 d9 f2 6c 11  .V..!...0..y..l.

0x20026f68: 0030:  d2                                               .

0x20026f68: => flush output

0x20026f68: message length: 49, out_left: 49

0x20026f68: ssl->f_send() returned 49 (-0xffffffcf)

0x20026f68: <= flush output

0x20026f68: <= write record

0x20026f68: <= write

0x20026f68: => read

0x20026f68: => read record

0x20026f68: => fetch input

0x20026f68: in_left: 0, nb_want: 5

0x20026f68: in_left: 0, nb_want: 5

0x20026f68: ssl->f_recv(_timeout)() returned 5 (-0xfffffffb)

0x20026f68: <= fetch input

0x20026f68: dumping 'input record header' (5 bytes)

0x20026f68: 0000:  15 03 03 00 1a                                   .....

0x20026f68: input record: msgtype = 21, version = [3:3], msglen = 26

0x20026f68: => fetch input
0x20026f68: in_left: 5, nb_want: 31

0x20026f68: in_left: 5, nb_want: 31

0x20026f68: ssl->f_recv(_timeout)() returned 26 (-0xffffffe6)

0x20026f68: <= fetch input

0x20026f68: dumping 'input record from network' (31 bytes)

0x20026f68: 0000:  15 03 03 00 1a 00 00 00 00 00 00 00 01 cd 3b d1  ..............;.

0x20026f68: 0010:  e5 96 7a 71 66 41 df 1d d8 46 b8 ca df 17 58     ..zqfA...F....X

0x20026f68: => decrypt buf

0x20026f68: dumping 'additional data used for AEAD' (13 bytes)

0x20026f68: 0000:  00 00 00 00 00 00 00 01 15 03 03 00 02           .............

0x20026f68: dumping 'IV used' (12 bytes)

0x20026f68: 0000:  c0 c6 ea 78 00 00 00 00 00 00 00 01              ...x........

0x20026f68: dumping 'TAG used' (16 bytes)

0x20026f68: 0000:  d1 e5 96 7a 71 66 41 df 1d d8 46 b8 ca df 17 58  ...zqfA...F....X

0x20026f68: <= decrypt buf

0x20026f68: dumping 'input payload after decrypt' (2 bytes)

0x20026f68: 0000:  01 00                                            ..

0x20026f68: got an alert message, type: [1:0]

0x20026f68: **mbedtls_ssl_handle_message_type() returned -30848 (-0x7880)**

0x20026f68: **mbedtls_ssl_read_record() returned -30848 (-0x7880)**

Can you help how to fix this issue?

Thanks,

Which code and hardware platform are you using? Can you verify that your cert and keys are correct by using mosquitto client as mentioned above?

1 Like

@aggarg Thanks for your replay.

The issue is resolved now that was due to AWS certificates.

Thank you for reporting back.