aws / amazon-freertos

DEPRECATED - See README.md
https://aws.amazon.com/freertos/
MIT License
2.54k stars 1.1k forks source link

MQTT Agent doesn't connect on MQTT v2 #1385

Closed sumit612 closed 4 years ago

sumit612 commented 4 years ago

Describe the bug MQTT agent was connecting with TLS certificates in MQTT v1. After porting the same application on MQTT v2 with same connect flags( mqttagentREQUIRE_TLS | mqttagentUSE_AWS_IOT_ALPN_443 ) and credentials MQTT_AGENT_CONNECT() fails to connect with AWS broker via wifi while MQTT Demo is working fine.

System information

Expected behavior Should connect with AWS mqtt broker

Screenshots or console output 37 1270 [MqttTask] ERROR: Handshake failed with error code -9984 38 1270 [MqttTask] [ERROR][NET][12700] Failed to establish new connection. 39 1270 [MqttTask] [ERROR][MQTT][12700] Failed to establish new MQTT connection, error NETWORK ERROR.

sarenameas commented 4 years ago

Hello sumit612,

Using the latest in master as of this post. I am able to make an MQTT connection with your xConnectParameters.

I added to ESP32's aws_demo_config.h:

#define democonfigMQTT_AGENT_CONNECT_FLAGS             ( mqttagentREQUIRE_TLS | mqttagentUSE_AWS_IOT_ALPN_443 )

My quick and dirty code:

    MQTTAgentHandle_t xMQTTClientHandle;

    /* Create MQTT Client. */
    if( MQTT_AGENT_Create( &( xMQTTClientHandle ) ) == eMQTTAgentSuccess )
    {
        MQTTAgentConnectParams_t xConnectParams =
        {
            clientcredentialMQTT_BROKER_ENDPOINT,
            democonfigMQTT_AGENT_CONNECT_FLAGS,
            pdFALSE,
            clientcredentialMQTT_BROKER_PORT,
            ( const uint8_t * ) ( clientcredentialIOT_THING_NAME ),
            ( uint16_t ) strlen( ( const char * ) clientcredentialIOT_THING_NAME ),
            pdFALSE,
            NULL,
            NULL, /* No call back not needed just to connect. */
            NULL,
            0
        };

        if( MQTT_AGENT_Connect( xMQTTClientHandle,
                                &xConnectParams,
                                pdMS_TO_TICKS( 20000UL ) ) != eMQTTAgentSuccess )
        {
            configPRINTF( ( "ERROR: Could not connect to the Broker.\r\n" ) );
        }
        else
        {
            if( MQTT_AGENT_Disconnect( xMQTTClientHandle,
                                   pdMS_TO_TICKS( 20000UL ) ) == eMQTTAgentSuccess )
            {
                configPRINTF( ( "Disconnected from the broker.\r\n" ) );

                if( MQTT_AGENT_Delete( xMQTTClientHandle ) == eMQTTAgentSuccess )
                {
                    configPRINTF( ( "Deleted Client.\r\n" ) );
                }
                else
                {
                    configPRINTF( ( "ERROR:  MQTT_AGENT_Delete() Failed.\r\n" ) );
                }
            }
            else
            {
                configPRINTF( ( "ERROR:  Did not disconnected from the broker.\r\n" ) );
            }
        }
    }

my output:

5 303 [iot_thread] [INFO ][DEMO][3030] Successfully initialized the demo. Network type for the demo: 1
6 783 [iot_thread] [INFO ][MQTT][7830] Establishing new MQTT connection.
7 784 [iot_thread] [INFO ][MQTT][7830] Anonymous metrics (SDK language, SDK version) will be provided to AWS IoT. Recompile with AWS_IOT_MQTT_ENABLE_METRICS set to 0 to disable.
8 784 [iot_thread] [INFO ][MQTT][7840] (MQTT connection 0x3ffe2f3c, CONNECT operation 0x3ffe210c) Waiting for operation completion.
9 811 [iot_thread] [INFO ][MQTT][8110] (MQTT connection 0x3ffe2f3c, CONNECT operation 0x3ffe210c) Wait complete with result SUCCESS.
10 811 [iot_thread] [INFO ][MQTT][8110] New MQTT connection 0x3ffe224c established.
11 811 [iot_thread] [INFO ][MQTT][8110] (MQTT connection 0x3ffe2f3c) Disconnecting connection.
12 811 [iot_thread] [INFO ][MQTT][8110] (MQTT connection 0x3ffe2f3c, DISCONNECT operation 0x3ffe210c) Waiting for operation completion.
13 813 [iot_thread] [INFO ][MQTT][8130] (MQTT connection 0x3ffe2f3c, DISCONNECT operation 0x3ffe210c) Wait complete with result SUCCESS.
14 813 [iot_thread] [INFO ][MQTT][8130] (MQTT connection 0x3ffe2f3c) Connection disconnected.
15 814 [iot_thread] [INFO ][MQTT][8140] (MQTT connection 0x3ffe2f3c) Network connection closed.
16 817 [iot_thread] [INFO ][MQTT][8170] (MQTT connection 0x3ffe2f3c) Network connection destroyed.
17 818 [iot_thread] Disconnected from the broker.
18 818 [iot_thread] Deleted Client.
19 818 [iot_thread] ----Demo finished----
20 818 [iot_thread] [INFO ][DEMO][8180] Demo completed successfully.
21 919 [iot_thread] [INFO ][INIT][9190] SDK cleanup done.
22 919 [iot_thread] [INFO ][DEMO][9190] -------DEMO FINISHED-------

About your output:

37 1270 [MqttTask] ERROR: Handshake failed with error code -9984

This error translates to -2700 in libraries\3rdparty\mbedtls\include\mbedtls\x509.h. This means some certificate verification failed somewhere down the handshake process. Please check and make sure that the keys in demos\include\aws_clientcredential_keys.h are correct and in correct format. Also that those keys are associated with your thing.

sumit612 commented 4 years ago

But used the same credential in my previous code and it connected every time. The previous AFR version was "Amazon FreeRTOS V1.4.1".

The previous config: prev_tls_config

The new config: new_tls_config

After that I enabled multi blob support. But no change.

*Else I only see the difference is the newer AFR is using new vDevModeKeyProvisioning()

sarenameas commented 4 years ago

Yes I think turning on mbedtls debug logs would help. Please send that log to us. Are you using the default esp_config.h (under vendors\espressif\boards\esp32\aws_demos\application_code\espressif_code\mbedtls\port\include\mbedtls\esp_config.h)? If you changed your mbedtls config.h please post it here. Also make sure that you are erasing the flash before reprogramming.

sumit612 commented 4 years ago

No, I didn't change anything on that file. I also tried erasing flash. And in this application bluetooth is activated with Nimble host stack.

Here is the debug log:

4819 16161 [MqttTask] mbedTLS: |2| 0x3ffd27f8: => handshake
4820 16161 [MqttTask] mbedTLS: |2| 0x3ffd27f8: client state: 0
4821 16161 [MqttTask] mbedTLS: |2| 0x3ffd27f8: => flush output
4822 16161 [MqttTask] mbedTLS: |2| 0x3ffd27f8: <= flush output
4823 16161 [MqttTask] mbedTLS: |2| 0x3ffd27f8: client state: 1
4824 16161 [MqttTask] mbedTLS: |2| 0x3ffd27f8: => flush output
4825 16161 [MqttTask] mbedTLS: |2| 0x3ffd27f8: <= flush output
4826 16161 [MqttTask] mbedTLS: |2| 0x3ffd27f8: => write client hello
4827 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, max version: [3:3]
4828 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, current time: 161
4829 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: dumping 'client hello, random bytes' (32 bytes)
4830 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: 0000:  00 00 00 a1 1c 3e ee 47 d7 d0 d3 e3 65 a5 31 a6  .....>.G....e.1.
4831 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: 0010:  9c 48 58 67 19 dd 5d 9f 42 8b 59 fc 76 5d 53 70  .HXg..].B.Y.v]Sp
4832 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, session id len.: 0
4833 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: dumping 'client hello, session id' (0 bytes)
4834 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c0ad
4835 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c09f
4836 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: 006b
4837 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c00a
4838 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c014
4839 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: 0039
4840 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c0af
4841 16161 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c0a3
4842 16162 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c02b
4843 16162 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c02f
4844 16162 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: 009e
4845 16162 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c0ac
4846 16162 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c09e
4847 16162 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c023
4848 16162 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c027
4849 16162 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: 0067
4850 16162 [MqttTask] mbedTLS: |3| 0x3ffd27f8: client hello, add ciphersuite: c009
4920 16548 [MqttTask] mbedTLS: |2| 0x3ffd27f8: in_left: 0, nb_want: 5
4921 16548 [MqttTask] mbedTLS: |2| 0x3ffd27f8: ssl->f_recv(_timeout)() returned 5 (-0xfffffffb)
4922 16548 [MqttTask] mbedTLS: |2| 0x3ffd27f8: <= fetch input
4923 16548 [MqttTask] mbedTLS: |4| 0x3ffd27f8: dumping 'input record header' (5 bytes)
4924 16548 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0000:  16 03 03 15 24                                   ....$
4925 16548 [MqttTask] mbedTLS: |3| 0x3ffd27f8: input record: msgtype = 22, version = [3:3], msglen = 5412
4926 16548 [MqttTask] mbedTLS: |2| 0x3ffd27f8: => fetch input
4927 16548 [MqttTask] mbedTLS: |2| 0x3ffd27f8: in_left: 5, nb_want: 5417
4928 16548 [MqttTask] mbedTLS: |2| 0x3ffd27f8: in_left: 5, nb_want: 5417
4929 16548 [MqttTask] mbedTLS: |2| 0x3ffd27f8: ssl->f_recv(_timeout)() returned 1395 (-0xfffffa8d)
4930 16584 [MqttTask] mbedTLS: |2| 0x3ffd27f8: in_left: 1400, nb_want: 5417
4931 16584 [MqttTask] mbedTLS: |2| 0x3ffd27f8: ssl->f_recv(_timeout)() returned 1400 (-0xfffffa88)
4932 16648 [MqttTask] mbedTLS: |2| 0x3ffd27f8: in_left: 2800, nb_want: 5417
4933 16648 [MqttTask] mbedTLS: |2| 0x3ffd27f8: ssl->f_recv(_timeout)() returned 1400 (-0xfffffa88)

I (167850) [vProcessMqttAgentDisconnect]: MQTT Return Value: 1

4934 16749 [MqttTask] mbedTLS: |2| 0x3ffd27f8: in_left: 4200, nb_want: 5417
4935 16749 [MqttTask] mbedTLS: |2| 0x3ffd27f8: ssl->f_recv(_timeout)() returned 1217 (-0xfffffb3f)
4936 16749 [MqttTask] mbedTLS: |2| 0x3ffd27f8: <= fetch input
4937 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: dumping 'input record from network' (5417 bytes)
4938 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0000:  16 03 03 15 24 02 00 00 51 03 03 d1 70 8d cf 6c  ....$...Q...p..l
4939 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0010:  af 5d e1 bf 1f 4b b2 50 5b d2 44 47 17 da fe 60  .]...K.P[.DG...`
4940 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0020:  9e 8e 55 5b f9 25 7f 0a b0 ef 48 20 63 71 7e 69  ..U[.H cq~i
4941 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0030:  2b 03 2f df d7 79 a3 1e 12 ad ac 33 43 17 f7 f6  +./..y.....3C...
4942 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0040:  0f 09 84 cb 75 6c ea a6 c6 54 43 17 c0 2f 00 00  ....ul...TC../..
4943 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0050:  09 ff 01 00 01 00 00 17 00 00 0b 00 13 10 00 13  ................
4944 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0060:  0d 00 05 a5 30 82 05 a1 30 82 04 89 a0 03 02 01  ....0...0.......
4945 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0070:  02 02 10 0c 62 ff 6c 06 6e ad 10 24 28 8a 6c f1  ....b.l.n..$(.l.
4946 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0080:  9d d4 dc 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b  ...0...*.H......
4947 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0090:  05 00 30 46 31 0b 30 09 06 03 55 04 06 13 02 55  ..0F1.0...U....U
4948 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 00a0:  53 31 0f 30 0d 06 03 55 04 0a 13 06 41 6d 61 7a  S1.0...U....Amaz
4949 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 00b0:  6f 6e 31 15 30 13 06 03 55 04 0b 13 0c 53 65 72  on1.0...U....Ser
4950 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 00c0:  76 65 72 20 43 41 20 31 42 31 0f 30 0d 06 03 55  ver CA 1B1.0...U
4951 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 00d0:  04 03 13 06 41 6d 61 7a 6f 6e 30 1e 17 0d 31 39  ....Amazon0...19
4952 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 00e0:  30 37 30 32 30 30 30 30 30 30 5a 17 0d 32 30 30  0702000000Z..200
4953 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 00f0:  36 32 38 31 32 30 30 30 30 5a 30 28 31 26 30 24  628120000Z0(1&0$
4954 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0100:  06 03 55 04 03 0c 1d 2a 2e 69 6f 74 2e 65 75 2d  ..U....*.iot.eu-
4955 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0110:  77 65 73 74 2d 31 2e 61 6d 61 7a 6f 6e 61 77 73  west-1.amazonaws
4956 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0120:  2e 63 6f 6d 30 82 01 22 30 0d 06 09 2a 86 48 86  .com0.."0...*.H.
4957 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0130:  f7 0d 01 01 01 05 00 03 82 01 0f 00 30 82 01 0a  ............0...
4958 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0140:  02 82 01 01 00 b8 3a fe e9 67 b1 86 99 0c 62 a8  ......:..g....b.
4959 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0150:  41 4d 48 4b 9c 21 da df d3 86 97 e0 68 a2 a4 30  AMHK.!......h..0
4960 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0160:  6f bd 4b 10 6a 61 b6 1f 86 fe ee 90 e8 b4 2c f3  o.K.ja........,.
4961 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0170:  19 78 ae 61 5d 62 db df 67 9e 90 8e 97 69 3f bb  .x.a]b..g....i?.
4962 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0180:  b6 a7 14 c4 82 af 46 b2 25 02 c8 cf 4c 06 30 44  ......F.
4963 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 0190:  da a4 7a bb 69 31 71 c2 9a 5c 1a a0 24 db c9 78  ..z.i1q..\..$..x
4964 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 01a0:  fa 57 28 93 9c c4 05 bf 0e d8 13 98 20 e0 ba df  .W(......... ...
4965 16749 [MqttTask] mbedTLS: |4| 0x3ffd27f8: 01b0:  3a 40 c0 0f 9a 30 e3 f3 75 bd d9 57 88 5d a0 86  :@...0..u..W.]..
sumit612 commented 4 years ago

My flash partition is like this:

Name, Type, SubType, Offset, Size, Flags

Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild

nvs, data, nvs, 0x10000, 0x6000 otadata, data, ota, 0x16000, 0x2000 phy_init, data, phy, 0x18000, 0x2000 ota_0, 0, ota_0, 0x20000, 1M ota_1, 0, ota_1, 0x120000 , 1M factory, 0, 0, 0x220000 , 1M storage, data, nvs, , 0x10000 storage1, data, spiffs, , 400K

sumit612 commented 4 years ago

I just found it connects from iot_demo_mqtt.c, but fails from any file from "vendors\espressif\boards\esp32\aws_demos\application_code\" directory.

sumit612 commented 4 years ago
sarenameas commented 4 years ago

Hello Sumit612,

How did you discover you had a stack overflow? Did you end up in function: vApplicationStackOverflowHook()? If your task did end up here, you could also update the stack in parameter usStackDepth instead of changing the TLS settings which may other have consequences.

Also, changing any settings in this menu:

image

DOES change the mbedtls config file. If there any other settings in this menu you have updated, could you please send us the resulting sdkconfig.h generated file after building the code?

Also your mbedtls log seems to be missing information? Could you post the logs all the way up until the following log?

37 1270 [MqttTask] ERROR: Handshake failed with error code -9984
sumit612 commented 4 years ago

mbedTLS: |1| 0x3fffcc30: alloc(16701 bytes) failed

`7 822 [iot_thread] [INFO ][DEMO][8220] Successfully initialized the demo. Network type for the demo: 1
8 903 [iot_thread] mbedTLS: |2| 0x3ffe3424: => handshake
9 903 [iot_thread] mbedTLS: |2| 0x3ffe3424: client state: 0
10 903 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
11 903 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= flush output
12 903 [iot_thread] mbedTLS: |2| 0x3ffe3424: client state: 1
13 903 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
14 903 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= flush output
15 903 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write client hello
16 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, max version: [3:3]
17 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, current time: 9
18 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: dumping 'client hello, random bytes' (32 bytes)
19 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0000:  00 00 00 09 aa f2 85 23 2d 15 59 b2 cc 72 05 41  .......#-.Y..r.A
20 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0010:  a9 87 e2 ec 09 c3 cf a5 32 d1 c0 fd 06 46 a5 da  ........2....F..
21 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, session id len.: 0
22 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: dumping 'client hello, session id' (0 bytes)
23 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c0ad
24 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c09f
25 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: 006b
26 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c00a
27 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c014
28 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: 0039
29 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c0af
30 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c0a3
31 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c02b
32 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c02f
33 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: 009e
34 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c0ac
35 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c09e
36 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c023
37 903 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c027
38 906 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: 0067
39 906 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c009
40 906 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c013
41 906 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: 0033
42 906 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c0ae
43 906 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c0a2
44 906 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: c09d
45 906 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: 003d
46 906 [iot_thread] mbedTLS: |3| 0x3ffe3424: client hello, add ciphersuite: 0035
93 909 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00f0:  17 00 00 00 10 00 11 00 0f 0e 78 2d 61 6d 7a 6e  ..........x-amzn
94 909 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0100:  2d 6d 71 74 74 2d 63 61 00 23 00 00              -mqtt-ca.#..
95 909 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
97 910 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_send() returned 268 (-0xfffffef4)
109 935 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 0, nb_want: 5
110 935 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_recv(_timeout)() returned 5 (-0xfffffffb)
111 935 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= fetch input
112 935 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'input record header' (5 bytes)
113 935 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  16 03 03 15 24                                   ....$
114 935 [iot_thread] mbedTLS: |3| 0x3ffe3424: input record: msgtype = 22, version = [3:3], msglen = 5412
115 935 [iot_thread] mbedTLS: |2| 0x3ffe3424: => fetch input
116 935 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 5, nb_want: 5417
117 935 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 5, nb_want: 5417
118 935 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_recv(_timeout)() returned 1395 (-0xfffffa8d)
119 955 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 1400, nb_want: 5417
120 955 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_recv(_timeout)() returned 1400 (-0xfffffa88)
121 986 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 2800, nb_want: 5417
122 986 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_recv(_timeout)() returned 1400 (-0xfffffa88)
123 1006 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 4200, nb_want: 5417
124 1006 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_recv(_timeout)() returned 1217 (-0xfffffb3f)
125 1006 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= fetch input
126 1006 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'input record from network' (5417 bytes)
127 1006 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  16 03 03 15 24 02 00 00 51 03 03 08 42 41 50 b8  ....$...Q...BAP.
128 1006 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0010:  94 75 7e 2c 87 ee 8c e1 6e 43 d4 d4 55 b8 c4 73  .u~,....nC..U..s
129 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0020:  ef 62 eb 2e b0 34 55 e8 4a 92 e2 20 78 35 1b cd  .b...4U.J.. x5..
130 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0030:  55 92 91 94 03 c3 b9 4e 5b 0e 06 a5 d8 ce 9a b7  U......N[.......
131 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0040:  f2 4a 75 bf 71 3f e2 a7 e4 84 39 d3 c0 2f 00 00  .Ju.q?....9../..
132 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0050:  09 ff 01 00 01 00 00 17 00 00 0b 00 13 10 00 13  ................
133 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0060:  0d 00 05 a5 30 82 05 a1 30 82 04 89 a0 03 02 01  ....0...0.......
134 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0070:  02 02 10 0c 62 ff 6c 06 6e ad 10 24 28 8a 6c f1  ....b.l.n..$(.l.
135 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0080:  9d d4 dc 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b  ...0...*.H......
136 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0090:  05 00 30 46 31 0b 30 09 06 03 55 04 06 13 02 55  ..0F1.0...U....U
137 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00a0:  53 31 0f 30 0d 06 03 55 04 0a 13 06 41 6d 61 7a  S1.0...U....Amaz
138 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00b0:  6f 6e 31 15 30 13 06 03 55 04 0b 13 0c 53 65 72  on1.0...U....Ser
139 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00c0:  76 65 72 20 43 41 20 31 42 31 0f 30 0d 06 03 55  ver CA 1B1.0...U
140 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00d0:  04 03 13 06 41 6d 61 7a 6f 6e 30 1e 17 0d 31 39  ....Amazon0...19
141 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00e0:  30 37 30 32 30 30 30 30 30 30 5a 17 0d 32 30 30  0702000000Z..200
142 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00f0:  36 32 38 31 32 30 30 30 30 5a 30 28 31 26 30 24  628120000Z0(1&0$
143 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0100:  06 03 55 04 03 0c 1d 2a 2e 69 6f 74 2e 65 75 2d  ..U....*.iot.eu-
144 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0110:  77 65 73 74 2d 31 2e 61 6d 61 7a 6f 6e 61 77 73  west-1.amazonaws
145 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0120:  2e 63 6f 6d 30 82 01 22 30 0d 06 09 2a 86 48 86  .com0.."0...*.H.
146 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0130:  f7 0d 01 01 01 05 00 03 82 01 0f 00 30 82 01 0a  ............0...
147 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0140:  02 82 01 01 00 b8 3a fe e9 67 b1 86 99 0c 62 a8  ......:..g....b.
148 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0150:  41 4d 48 4b 9c 21 da df d3 86 97 e0 68 a2 a4 30  AMHK.!......h..0
149 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0160:  6f bd 4b 10 6a 61 b6 1f 86 fe ee 90 e8 b4 2c f3  o.K.ja........,.
150 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0170:  19 78 ae 61 5d 62 db df 67 9e 90 8e 97 69 3f bb  .x.a]b..g....i?.
151 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0180:  b6 a7 14 c4 82 af 46 b2 25 02 c8 cf 4c 06 30 44  ......F.
152 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0190:  da a4 7a bb 69 31 71 c2 9a 5c 1a a0 24 db c9 78  ..z.i1q..\..$..x
153 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 01a0:  fa 57 28 93 9c c4 05 bf 0e d8 13 98 20 e0 ba df  .W(......... ...
154 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 01b0:  3a 40 c0 0f 9a 30 e3 f3 75 bd d9 57 88 5d a0 86  :@...0..u..W.]..
155 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 01c0:  44 87 f5 e6 9d f0 f4 7c df 73 ba 6c f0 3f 0b 6f  D......|.s.l.?.o
156 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 01d0:  07 85 b7 21 7d 22 cd 87 2e 87 a7 19 85 5b 80 ae  ...!}".......[..
157 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 01e0:  2e 2f 12 42 39 91 1b d1 ed a4 dc 5b 14 05 87 2b  ./.B9......[...+
158 1009 [iot_thread] mbedTLS: |4| 0x3ffe3424: 01f0:  94 cf c4 e3 b0 6d 46 bf 92 27 da 7a 98 91 16 45  .....mF..'.z...E
175 1010 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0300:  2b 06 01 05 05 07 03 02 30 3b 06 03 55 1d 1f 04  +.......0;..U...
182 1011 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0370:  07 01 01 04 69 30 67 30 2d 06 08 2b 06 01 05 05  ....i0g0-..+....
231 1014 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0680:  32 32 30 30 30 30 30 30 5a 17 0d 32 35 31 30 31  22000000Z..25101
232 1014 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0690:  39 30 30 30 30 30 30 5a 30 46 31 0b 30 09 06 03  9000000Z0F1.0...
240 1016 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0710:  1d e6 d1 12 e8 12 28 48 cc e8 29 c1 b9 6e 53 d5  ......(H..)..nS.
241 1016 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0720:  a3 eb 03 39 1a cc 77 87 f6 01 b9 d9 70 cc cf 6b  ...9..w.....p..k
257 1016 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0820:  01 00 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02  ..0...U.........
258 1018 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0830:  01 86 30 1d 06 03 55 1d 0e 04 16 04 14 59 a4 66  ..0...U......Y.f
262 1020 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0870:  0a 08 30 7b 06 08 2b 06 01 05 05 07 01 01 04 6f  ..0{..+........o
310 1023 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0b70:  03 13 10 41 6d 61 7a 6f 6e 20 52 6f 6f 74 20 43  ...Amazon Root C
311 1023 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0b80:  41 20 31 30 82 01 22 30 0d 06 09 2a 86 48 86 f7  A 10.."0...*.H..
323 1023 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0c40:  91 f9 48 dc ff d1 e8 30 2d 7d 2d 74 70 35 d7 88  ..H....0-}-tp5..
324 1024 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0c50:  24 f7 9e c4 59 6e bb 73 87 17 f2 32 46 28 b8 43  $...Yn.s...2F(.C
359 1025 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0e80:  94 e6 39 31 5f 7c 73 cb 90 88 6a 84 11 96 27 a6  ..91_|s...j...'.
363 1027 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0ec0:  17 81 61 f1 ca f9 10 02 24 ab eb 0d 74 91 8d 7b  ..a.....$...t..{
408 1030 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'remaining content in record' (5327 bytes)
409 1030 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  0b 00 13 10 00 13 0d 00 05 a5 30 82 05 a1 30 82  ..........0...0.
455 1031 [iot_thread] mbedTLS: |4| 0x3ffe3424: 02e0:  6d 2f 73 63 61 31 62 2e 63 72 6c 30 20 06 03 55  m/sca1b.crl0 ..U
459 1032 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0320:  08 2b 06 01 05 05 07 30 01 86 21 68 74 74 70 3a  .+.....0..!http:
463 1033 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0360:  2f 63 72 74 2e 73 63 61 31 62 2e 61 6d 61 7a 6f  /crt.sca1b.amazo
479 1035 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0460:  62 1b 62 86 2d 52 19 23 66 a1 be c6 af 39 72 28  b.b.-R.#f....9r(
480 1035 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0470:  d5 10 4a c5 f2 66 fe f5 02 21 00 c7 a5 aa b1 30  ..J..f...!.....0
527 1037 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0760:  67 f0 d0 88 ca 3a d1 17 73 f5 5f 9a d4 c5 72 1e  g....:..s._...r.
528 1038 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0770:  7e 01 f1 98 30 63 2a aa f2 7a 2d c5 e2 02 1a 86  ~...0c*..z-.....
532 1040 [iot_thread] mbedTLS: |4| 0x3ffe3424: 07b0:  30 82 01 37 30 12 06 03 55 1d 13 01 01 ff 04 08  0..70...U.......
579 1043 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0aa0:  66 69 65 6c 64 20 53 65 72 76 69 63 65 73 20 52  field Services R
580 1043 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0ab0:  6f 6f 74 20 43 65 72 74 69 66 69 63 61 74 65 20  oot Certificate
615 1043 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0ce0:  70 2e 72 6f 6f 74 67 32 2e 61 6d 61 7a 6f 6e 74  p.rootg2.amazont
616 1044 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0cf0:  72 75 73 74 2e 63 6f 6d 30 38 06 08 2b 06 01 05  rust.com08..+...
627 1045 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0da0:  8b 2c e9 0c 9b 6c 45 e2 07 00 7a f9 c5 58 0b b9  .,...lE...z..X..
632 1047 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0df0:  f9 9a 7b 22 9d a7 00 09 7e ac 46 17 83 dc 9c 26  ..{"....~.F....&
648 1049 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0ef0:  65 73 2c 20 49 6e 63 2e 31 32 30 30 06 03 55 04  es, Inc.1200..U.
649 1049 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0f00:  0b 13 29 53 74 61 72 66 69 65 6c 64 20 43 6c 61  ..)Starfield Cla
667 1052 [iot_thread] mbedTLS: |3| 0x3ffe3424: peer certificate #1:
668 1052 [iot_thread] mbedTLS: |3| 0x3ffe3424: cert. version     : 3
674 1052 [iot_thread] mbedTLS: |3| 0x3ffe3424: signed using      : RSA with SHA-256
745 1053 [iot_thread] mbedTLS: |3| 0x3ffe3424:  f5 b5 19 f8 49 68 b0 de d7 b9 76 38 1d 61 9e a4
746 1055 [iot_thread] mbedTLS: |3| 0x3ffe3424:  fe 82 36 a5 e5 4a 56 e4 45 e1 f9 fd b4 16 fa 74
750 1055 [iot_thread] mbedTLS: |3| 0x3ffe3424:  c0 30 86 66 a1 45 66 ba 54 eb a3 c3 91 f9 48 dc
751 1057 [iot_thread] mbedTLS: |3| 0x3ffe3424:  ff d1 e8 30 2d 7d 2d 74 70 35 d7 88 24 f7 9e c4
789 1087 [iot_thread] mbedTLS: |3| 0x3ffe3424: Certificate verification flags clear
790 1087 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= parse certificate
791 1087 [iot_thread] mbedTLS: |2| 0x3ffe3424: client state: 4
792 1087 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
793 1087 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= flush output
794 1087 [iot_thread] mbedTLS: |2| 0x3ffe3424: => parse server key exchange
795 1087 [iot_thread] mbedTLS: |2| 0x3ffe3424: => read record
796 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'remaining content in record' (443 bytes)
797 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  0c 00 01 8d 03 00 19 85 04 00 43 63 d8 96 69 79  ..........Cc..iy
798 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0010:  3c f0 99 99 17 7b ad d9 32 0c 32 d7 69 80 9b ac  <....{..2.2.i...
799 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0020:  0b 66 46 9f 81 4c 3b 4f 29 ab 30 05 2d 11 91 a8  .fF..L;O).0.-...
800 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0030:  52 db c9 5c ae 7a 37 13 89 db 47 c5 4a 57 ac 2c  R..\.z7...G.JW.,
801 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0040:  f1 69 19 f1 f7 00 18 d1 58 46 a4 01 d8 6a 8d 8a  .i......XF...j..
802 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0050:  45 e5 21 91 c3 51 30 47 36 1f ac 21 7d ca a4 9e  E.!..Q0G6..!}...
803 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0060:  2a d5 41 27 03 6b e3 8e c7 6a 97 b1 7f da 4f 67  *.A'.k...j....Og
804 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0070:  53 46 77 cb 56 98 8d ea 1f 55 b3 3e a4 0e 67 96  SFw.V....U.>..g.
805 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0080:  bd 28 9e 3d 94 a8 fa 78 8d c3 ba b7 2e 04 01 01  .(.=...x........
806 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0090:  00 72 af c0 85 74 66 de 58 31 b3 b9 fa 70 78 ca  .r...tf.X1...px.
807 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00a0:  ad 27 d1 0c 3b 73 38 39 e7 79 1a bc ca a1 52 94  .'..;s89.y....R.
808 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00b0:  fd 6a 75 04 3a af 89 80 9b b8 10 55 1f d6 08 72  .ju.:......U...r
809 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00c0:  24 0d a2 cc 0d 51 ca 87 ce 94 4b 60 0a b2 1f f5  $....Q....K`....
810 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00d0:  2c 25 95 9a 03 5c b6 37 f4 dc f2 26 06 f2 e6 47  ,\.7...&...G
811 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00e0:  d9 c6 1c fb f0 bc b2 2d 03 22 7f cf 1d f7 01 94  .......-."......
812 1087 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00f0:  c4 dc 73 86 ad 2b 5a 46 a8 1d 3e 58 e8 20 87 7b  ..s..+ZF..>X. .{
826 1089 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= read record
827 1089 [iot_thread] mbedTLS: |3| 0x3ffe3424: dumping 'server key exchange' (397 bytes)
871 1092 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0020:  6a 75 04 3a af 89 80 9b b8 10 55 1f d6 08 72 24  ju.:......U...r$
872 1092 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0030:  0d a2 cc 0d 51 ca 87 ce 94 4b 60 0a b2 1f f5 2c  ....Q....K`....,
873 1092 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0040:  25 95 9a 03 5c b6 37 f4 dc f2 26 06 f2 e6 47 d9  \.7...&...G.
888 1109 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= parse server key exchange
889 1109 [iot_thread] mbedTLS: |2| 0x3ffe3424: client state: 5
890 1109 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
891 1109 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= flush output
892 1109 [iot_thread] mbedTLS: |2| 0x3ffe3424: => parse certificate request
893 1109 [iot_thread] mbedTLS: |2| 0x3ffe3424: => read record
894 1112 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'remaining content in record' (42 bytes)
895 1112 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  0d 00 00 22 03 01 02 40 00 1a 06 03 06 01 05 03  ..."...@........
896 1112 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0010:  05 01 04 03 04 01 04 02 03 03 03 01 03 02 02 03  ................
897 1112 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0020:  02 01 02 02 00 00 0e 00 00 00                    ..........
898 1112 [iot_thread] mbedTLS: |3| 0x3ffe3424: handshake message: msglen = 42, type = 13, hslen = 38
899 1112 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= read record
900 1112 [iot_thread] mbedTLS: |3| 0x3ffe3424: got a certificate request
901 1112 [iot_thread] mbedTLS: |3| 0x3ffe3424: Supported Signature Algorithm found: 6,3
902 1112 [iot_thread] mbedTLS: |3| 0x3ffe3424: Supported Signature Algorithm found: 6,1
903 1112 [iot_thread] mbedTLS: |3| 0x3ffe3424: Supported Signature Algorithm found: 5,3
904 1112 [iot_thread] mbedTLS: |3| 0x3ffe3424: Supported Signature Algorithm found: 5,1
905 1112 [iot_thread] mbedTLS: |3| 0x3ffe3424: Supported Signature Algorithm found: 4,3
906 1112 [iot_thread] mbedTLS: |3| 0x3ffe3424: Supported Signature Algorithm found: 4,1
907 1112 [iot_thread] mbedTLS: |3| 0x3ffe3424: Supported Signature Algorithm found: 4,2
908 1112 [iot_thread] mbedTLS: |3| 0x3ffe3424: Supported Signature Algorithm found: 3,3
958 1114 [iot_thread] mbedTLS: |3| 0x3ffe3424:  01 00 01
960 1114 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write record
961 1115 [iot_thread] mbedTLS: |3| 0x3ffe3424: output record: msgtype = 22, version = [3:3], msglen = 872
980 1115 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0110:  06 c5 1f a7 ca c1 8f 27 20 e7 9b b1 93 44 b3 7e  .......' ....D.~
1020 1120 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_send() returned 877 (-0xfffffc93)
1021 1120 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= flush output
1022 1120 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= write record
1023 1120 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= write handshake message
1029 1330 [iot_thread] mbedTLS: |3| 0x3ffe3424: value of 'ECDH: Q(X)' (521 bits) is:
1030 1330 [iot_thread] mbedTLS: |3| 0x3ffe3424:  01 55 1c 09 cd 47 03 4e 17 ad 6e 59 1c 71 34 94
1031 1330 [iot_thread] mbedTLS: |3| 0x3ffe3424:  93 aa 3b f6 36 63 60 3c cd e6 b3 8b 2a 1b 90 34
1032 1330 [iot_thread] mbedTLS: |3| 0x3ffe3424:  54 b3 32 dd ff f6 e5 e6 84 f6 00 9e db 0d e2 d0
1033 1330 [iot_thread] mbedTLS: |3| 0x3ffe3424:  4e f5 97 71 bb 8d fe 4a b2 c7 c8 7b ee 2c f6 3a
1034 1330 [iot_thread] mbedTLS: |3| 0x3ffe3424:  cf 00
1035 1330 [iot_thread] mbedTLS: |3| 0x3ffe3424: value of 'ECDH: Q(Y)' (520 bits) is:
1036 1330 [iot_thread] mbedTLS: |3| 0x3ffe3424:  9c a9 49 ae 12 7e ee b6 51 32 5c f0 58 7c 3d ea
1037 1330 [iot_thread] mbedTLS: |3| 0x3ffe3424:  e8 90 76 24 d1 29 58 37 f9 c0 04 cd bd 89 11 f8
1038 1332 [iot_thread] mbedTLS: |3| 0x3ffe3424:  bf af a2 5b 33 85 c7 57 05 84 c7 32 d3 bc b6 d9
1039 1332 [iot_thread] mbedTLS: |3| 0x3ffe3424:  f4 4c 33 1e 35 67 73 fe 56 60 b1 c7 10 1a c3 f0
1040 1332 [iot_thread] mbedTLS: |3| 0x3ffe3424:  4d
1041 1549 [iot_thread] mbedTLS: |3| 0x3ffe3424: value of 'ECDH: z' (521 bits) is:
1042 1549 [iot_thread] mbedTLS: |3| 0x3ffe3424:  01 67 9a 2f db 7f 9d 29 3f 20 bb a8 49 37 f4 a5
1043 1549 [iot_thread] mbedTLS: |3| 0x3ffe3424:  c3 1b 27 88 20 05 db 3e 7e 4d bf 02 a0 1d bb 24
1044 1549 [iot_thread] mbedTLS: |3| 0x3ffe3424:  e5 d4 5f 3b 0d 35 fd 47 6f ce 15 97 c1 65 9d c9
1045 1549 [iot_thread] mbedTLS: |3| 0x3ffe3424:  67 05 17 46 51 3d 90 b8 3e 80 05 d5 02 cd 1c d6
1046 1549 [iot_thread] mbedTLS: |3| 0x3ffe3424:  58 a1
1047 1549 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write handshake message
1048 1549 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write record
1049 1549 [iot_thread] mbedTLS: |3| 0x3ffe3424: output record: msgtype = 22, version = [3:3], msglen = 138
1050 1550 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'output record sent to network' (143 bytes)
1051 1550 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  16 03 03 00 8a 10 00 00 86 85 04 01 55 1c 09 cd  ............U...
1052 1550 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0010:  47 03 4e 17 ad 6e 59 1c 71 34 94 93 aa 3b f6 36  G.N..nY.q4...;.6
1053 1550 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0020:  63 60 3c cd e6 b3 8b 2a 1b 90 34 54 b3 32 dd ff  c`<....*..4T.2..
1054 1550 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0030:  f6 e5 e6 84 f6 00 9e db 0d e2 d0 4e f5 97 71 bb  ...........N..q.
1055 1550 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0040:  8d fe 4a b2 c7 c8 7b ee 2c f6 3a cf 00 00 9c a9  ..J...{.,.:.....
1056 1550 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0050:  49 ae 12 7e ee b6 51 32 5c f0 58 7c 3d ea e8 90  I..~..Q2\.X|=...
1057 1550 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0060:  76 24 d1 29 58 37 f9 c0 04 cd bd 89 11 f8 bf af  v$.)X7..........
1058 1550 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0070:  a2 5b 33 85 c7 57 05 84 c7 32 d3 bc b6 d9 f4 4c  .[3..W...2.....L
1059 1550 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0080:  33 1e 35 67 73 fe 56 60 b1 c7 10 1a c3 f0 4d     3.5gs.V`......M
1060 1550 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
1061 1550 [iot_thread] mbedTLS: |2| 0x3ffe3424: message length: 143, out_left: 143
1062 1552 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_send() returned 143 (-0xffffff71)
1063 1552 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= flush output
1064 1552 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= write record
1065 1552 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= write handshake message
1066 1552 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= write client key exchange
1067 1552 [iot_thread] mbedTLS: |2| 0x3ffe3424: client state: 9
1068 1552 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
1069 1552 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= flush output
1070 1552 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write certificate verify
1071 1552 [iot_thread] mbedTLS: |2| 0x3ffe3424: => derive keys
1072 1552 [iot_thread] mbedTLS: |3| 0x3ffe3424: dumping 'premaster secret' (66 bytes)
1073 1552 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0000:  01 67 9a 2f db 7f 9d 29 3f 20 bb a8 49 37 f4 a5  .g./...)? ..I7..
1074 1552 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0010:  c3 1b 27 88 20 05 db 3e 7e 4d bf 02 a0 1d bb 24  ..'. ..>~M.....$
1075 1552 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0020:  e5 d4 5f 3b 0d 35 fd 47 6f ce 15 97 c1 65 9d c9  .._;.5.Go....e..
1076 1552 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0030:  67 05 17 46 51 3d 90 b8 3e 80 05 d5 02 cd 1c d6  g..FQ=..>.......
1091 1555 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0020:  9f e0 b5 3d 8a 95 f8 8d 68 96 f0 7b 84 a6 e8 fe  ...=....h..{....
1092 1555 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'random bytes' (64 bytes)
1093 1555 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  08 42 41 50 b8 94 75 7e 2c 87 ee 8c e1 6e 43 d4  .BAP..u~,....nC.
1121 1935 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write handshake message
1122 1936 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write record
1123 1936 [iot_thread] mbedTLS: |3| 0x3ffe3424: output record: msgtype = 22, version = [3:3], msglen = 264
1124 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'output record sent to network' (269 bytes)
1125 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  16 03 03 01 08 0f 00 01 04 04 01 01 00 3c 3f 0f  .............<?.
1126 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0010:  ff 04 e8 60 11 53 ae 2f 20 d8 cc 38 dc 2c d9 56  ...`.S./ ..8.,.V
1127 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0020:  28 d7 ef d6 19 b3 aa ee fb ae df 55 e9 73 d2 41  (..........U.s.A
1128 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0030:  e0 c9 ab 8d 40 b0 de ee e9 91 f1 a8 f3 e3 34 da  ....@.........4.
1129 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0040:  d4 5e 06 5d 2b 94 ed 9d e4 76 9f 02 06 5d 4b 41  .^.]+....v...]KA
1130 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0050:  b5 dd 97 93 01 84 64 0c 62 23 79 57 1a f4 bd 88  ......d.b#yW....
1131 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0060:  4c 45 61 ac 3d 98 be d1 03 82 30 c1 69 ac 0a fd  LEa.=.....0.i...
1132 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0070:  b1 bd 5e dc 33 71 78 46 59 14 0c b6 5e 65 0e 4f  ..^.3qxFY...^e.O
1133 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0080:  f0 95 9d af d8 d2 e8 0d f3 3e d1 89 54 f8 84 36  .........>..T..6
1134 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0090:  89 ea c4 a9 cd 29 03 5b 48 73 af e3 23 de ad 3f  .....).[Hs..#..?
1135 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00a0:  67 12 48 2b aa 0c e7 a1 ed 90 85 8b 74 bc 01 1c  g.H+........t...
1136 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00b0:  b5 9b 4f 93 c2 5c 12 96 5a 89 69 f8 36 1e 46 eb  ..O..\..Z.i.6.F.
1137 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00c0:  c3 b8 4d 1b fa dc 43 f7 53 6f 69 c0 34 02 eb 09  ..M...C.Soi.4...
1138 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00d0:  c1 7a 2c 00 c5 60 41 79 ee e0 1f a2 72 58 f4 08  .z,..`Ay....rX..
1139 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00e0:  db 4c 24 73 49 21 06 5f 6b 1d 16 d8 31 a2 fe ce  .L$sI!._k...1...
1140 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 00f0:  26 12 6a 05 60 d2 3f d5 14 16 10 80 ce 65 e7 cd  &.j.`.?......e..
1141 1936 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0100:  dd 89 d1 c8 e9 26 6f 9a 6e d3 28 e5 d9           .....&o.n.(..
1142 1936 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
1143 1936 [iot_thread] mbedTLS: |2| 0x3ffe3424: message length: 269, out_left: 269
1144 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_send() returned 269 (-0xfffffef3)
1145 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= flush output
1146 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= write record
1147 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= write handshake message
1148 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= write certificate verify
1149 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: client state: 10
1150 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
1151 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= flush output
1152 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write change cipher spec
1153 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write handshake message
1154 1937 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write record
1155 1937 [iot_thread] mbedTLS: |3| 0x3ffe3424: output record: msgtype = 20, version = [3:3], msglen = 1
1156 1937 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'output record sent to network' (6 bytes)
1197 1938 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
1198 1941 [iot_thread] mbedTLS: |2| 0x3ffe3424: message length: 45, out_left: 45
1199 1942 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_send() returned 45 (-0xffffffd3)
1211 1970 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 0, nb_want: 5
1212 1970 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_recv(_timeout)() returned 5 (-0xfffffffb)
1213 1970 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= fetch input
1214 1970 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'input record header' (5 bytes)
1215 1971 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  14 03 03 00 01                                   .....
1216 1971 [iot_thread] mbedTLS: |3| 0x3ffe3424: input record: msgtype = 20, version = [3:3], msglen = 1
1217 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: => fetch input
1218 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 5, nb_want: 6
1219 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 5, nb_want: 6
1220 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_recv(_timeout)() returned 1 (-0xffffffff)
1221 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= fetch input
1222 1971 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'input record from network' (6 bytes)
1223 1971 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  14 03 03 00 01 01                                ......
1224 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= read record
1225 1971 [iot_thread] mbedTLS: |3| 0x3ffe3424: switching to new transform spec for inbound data
1226 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= parse change cipher spec
1227 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: client state: 13
1228 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: => flush output
1229 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= flush output
1230 1971 [iot_thread] mbedTLS: |2| 0x3ffe3424: => parse finished
1231 1973 [iot_thread] mbedTLS: |2| 0x3ffe3424: => calc  finished tls sha256
1232 1973 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'finished sha2 state' (32 bytes)
1233 1973 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  d1 14 66 ca 38 8f a3 bd dd d2 40 f6 34 d6 f3 09  ..f.8.....@.4...
1234 1973 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0010:  6a 72 09 a1 c1 49 d3 99 00 25 5a 4c 8d 1d 00 20  jr...I...ZL...
1235 1973 [iot_thread] mbedTLS: |3| 0x3ffe3424: dumping 'calc finished result' (12 bytes)
1236 1973 [iot_thread] mbedTLS: |3| 0x3ffe3424: 0000:  9d 64 8e b2 6a f0 c9 87 ad 9f 8e a4              .d..j.......
1237 1973 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= calc  finished
1238 1975 [iot_thread] mbedTLS: |2| 0x3ffe3424: => read record
1239 1976 [iot_thread] mbedTLS: |2| 0x3ffe3424: => fetch input
1240 1976 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 0, nb_want: 5
1241 1976 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 0, nb_want: 5
1242 1976 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_recv(_timeout)() returned 5 (-0xfffffffb)
1243 1976 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= fetch input
1244 1976 [iot_thread] mbedTLS: |4| 0x3ffe3424: dumping 'input record header' (5 bytes)
1245 1976 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  16 03 03 00 28                                   ....(
1246 1976 [iot_thread] mbedTLS: |3| 0x3ffe3424: input record: msgtype = 22, version = [3:3], msglen = 40
1247 1976 [iot_thread] mbedTLS: |2| 0x3ffe3424: => fetch input
1248 1976 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 5, nb_want: 45
1249 1976 [iot_thread] mbedTLS: |2| 0x3ffe3424: in_left: 5, nb_want: 45
1250 1976 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_recv(_timeout)() returned 40 (-0xffffffd8)
1278 1978 [iot_thread] mbedTLS: |3| 0x3ffe3424: <= handshake wrapup: final free
1279 1978 [iot_thread] mbedTLS: |3| 0x3ffe3424: <= handshake wrapup
1280 1978 [iot_thread] mbedTLS: |2| 0x3ffe3424: <= handshake
1284 1978 [iot_thread] mbedTLS: |2| 0x3ffe3424: => write
1302 1981 [iot_thread] mbedTLS: |4| 0x3ffe3424: 0000:  00 00 00 00 00 00 00 01                          ........
1303 1981 [iot_thread] mbedTLS: |3| 0x3ffe3424: before encrypt: msglen = 144, including 0 bytes of padding
1322 1982 [iot_thread] mbedTLS: |2| 0x3ffe3424: ssl->f_send() returned 165 (-0xffffff5b)
1326 3978 [iot_thread] [INFO ][MQTT][39780] (MQTT connection 0x3ffe3bb0, CONNECT operation 0x3ffe39d4) Wait complete with result TIMEOUT.
1327 3978 [iot_thread] [ERROR][MQTT][39780] Failed to establish new MQTT connection, error TIMEOUT.
1328 3979 [iot_thread] [INFO ][MQTT][39790] Network connection closed on error.
`

/*
 *
 * Automatically generated file; DO NOT EDIT.
 * Espressif IoT Development Framework Configuration
 *
 */
#define CONFIG_ESP32_PHY_MAX_TX_POWER 20
#define CONFIG_FREERTOS_LEGACY_TICK_HOOK 1
#define CONFIG_TRACEMEM_RESERVE_DRAM 0x0
#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16
#define CONFIG_FATFS_LFN_NONE 1
#define CONFIG_FATFS_CODEPAGE_437 1
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000
#define CONFIG_SW_COEXIST_ENABLE 1
#define CONFIG_SPIFFS_USE_MAGIC_LENGTH 1
#define CONFIG_ESPTOOLPY_FLASHSIZE_4MB 1
#define CONFIG_IPC_TASK_STACK_SIZE 1024
#define CONFIG_FATFS_PER_FILE_CACHE 1
#define CONFIG_ESPTOOLPY_FLASHFREQ "40m"
#define CONFIG_MBEDTLS_KEY_EXCHANGE_RSA 1
#define CONFIG_NIMBLE_PINNED_TO_CORE 0
#define CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE 0
#define CONFIG_MBEDTLS_AES_C 1
#define CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED 1
#define CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN 752
#define CONFIG_MBEDTLS_GCM_C 1
#define CONFIG_ESPTOOLPY_FLASHSIZE "4MB"
#define CONFIG_HEAP_POISONING_DISABLED 1
#define CONFIG_SPIFFS_CACHE_WR 1
#define CONFIG_BROWNOUT_DET_LVL_SEL_0 1
#define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER 1
#define CONFIG_NIMBLE_ROLE_CENTRAL 1
#define CONFIG_BTDM_CONTROLLER_MODEM_SLEEP 1
#define CONFIG_NIMBLE_L2CAP_COC_MAX_NUM 0
#define CONFIG_SPIFFS_CACHE 1
#define CONFIG_INT_WDT 1
#define CONFIG_MBEDTLS_SSL_PROTO_TLS1 1
#define CONFIG_FREERTOS_LEGACY_IDLE_HOOK 1
#define CONFIG_MBEDTLS_ECDSA_C 1
#define CONFIG_ESPTOOLPY_FLASHFREQ_40M 1
#define CONFIG_LOG_BOOTLOADER_LEVEL_INFO 1
#define CONFIG_BOOTLOADER_OTA_ROLLBACK 1
#define CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE 0
#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1
#define CONFIG_MBEDTLS_ECDH_C 1
#define CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE 1
#define CONFIG_MBEDTLS_ECP_RESTARTABLE 1
#define CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM 16
#define CONFIG_MBEDTLS_SSL_ALPN 1
#define CONFIG_MBEDTLS_PEM_WRITE_C 1
#define CONFIG_BOOTLOADER_OTA_NO_FORCE_ROLLBACK 1
#define CONFIG_LOG_DEFAULT_LEVEL_INFO 1
#define CONFIG_BT_RESERVE_DRAM 0x10000
#define CONFIG_NIMBLE_MAX_CONNECTIONS 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_SPIFFS_META_LENGTH 4
#define CONFIG_ESP32_PANIC_PRINT_REBOOT 1
#define CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED 1
#define CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED 1
#define CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL 5
#define CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION 1
#define CONFIG_CONSOLE_UART_BAUDRATE 115200
#define CONFIG_NIMBLE_SM_SC 1
#define CONFIG_FREERTOS_USE_TRACE_FACILITY 1
#define CONFIG_TIMER_TASK_STACK_DEPTH 3584
#define CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED 1
#define CONFIG_FATFS_CODEPAGE 437
#define CONFIG_NIMBLE_ROLE_BROADCASTER 1
#define CONFIG_ESP32_DEFAULT_CPU_FREQ_160 1
#define CONFIG_ULP_COPROC_RESERVE_MEM 0
#define CONFIG_ESPTOOLPY_BAUD 921600
#define CONFIG_ADC_CAL_LUT_ENABLE 1
#define CONFIG_FLASHMODE_DIO 1
#define CONFIG_NIMBLE_MAX_BONDS 3
#define CONFIG_ESPTOOLPY_AFTER_RESET 1
#define CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED 1
#define CONFIG_TOOLPREFIX "xtensa-esp32-elf-"
#define CONFIG_MBEDTLS_ECP_C 1
#define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1024
#define CONFIG_MBEDTLS_RC4_DISABLED 1
#define CONFIG_CONSOLE_UART_NUM 0
#define CONFIG_ESP32_APPTRACE_LOCK_ENABLE 1
#define CONFIG_PTHREAD_STACK_MIN 768
#define CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC 1
#define CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS 1
#define CONFIG_CONSOLE_UART_DEFAULT 1
#define CONFIG_NIMBLE_HCI_EVT_LO_BUF_COUNT 8
#define CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN 16384
#define CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS 4
#define CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK 1
#define CONFIG_NIMBLE_SVC_GAP_APPEARANCE 0x0
#define CONFIG_ESPTOOLPY_FLASHSIZE_DETECT 1
#define CONFIG_NIMBLE_MAX_CCCDS 10
#define CONFIG_PARTITION_TABLE_CUSTOM 1
#define CONFIG_TIMER_TASK_STACK_SIZE 3584
#define CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE 1
#define CONFIG_MBEDTLS_X509_CRL_PARSE_C 1
#define CONFIG_MBEDTLS_CMAC_C 1
#define CONFIG_SPIFFS_USE_MAGIC 1
#define CONFIG_NIMBLE_SM_LEGACY 1
#define CONFIG_TASK_WDT 1
#define CONFIG_MAIN_TASK_STACK_SIZE 3584
#define CONFIG_SPIFFS_PAGE_CHECK 1
#define CONFIG_TASK_WDT_TIMEOUT_S 10
#define CONFIG_INT_WDT_TIMEOUT_MS 10000
#define CONFIG_NIMBLE_ATT_PREFERRED_MTU 256
#define CONFIG_ESPTOOLPY_FLASHMODE "dio"
#define CONFIG_NIMBLE_SVC_GAP_DEVICE_NAME "nimble"
#define CONFIG_NEWLIB_STDIN_LINE_ENDING_CR 1
#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA 1
#define CONFIG_NIMBLE_ROLE_OBSERVER 1
#define CONFIG_ESPTOOLPY_BEFORE "default_reset"
#define CONFIG_ADC2_DISABLE_DAC 1
#define CONFIG_LOG_DEFAULT_LEVEL 3
#define CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION 1
#define CONFIG_TIMER_QUEUE_LENGTH 10
#define CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT 1
#define CONFIG_MAKE_WARN_UNDEFINED_VARIABLES 1
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM 64
#define CONFIG_MBEDTLS_CCM_C 1
#define CONFIG_NIMBLE_HCI_EVT_BUF_SIZE 70
#define CONFIG_SPI_MASTER_ISR_IN_IRAM 1
#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20
#define CONFIG_ESP32_RTC_CLK_CAL_CYCLES 1024
#define CONFIG_ESP32_WIFI_TX_BA_WIN 6
#define CONFIG_ESP32_WIFI_NVS_ENABLED 1
#define CONFIG_IDF_TARGET_ESP32 1
#define CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL 1
#define CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED 1
#define CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED 1
#define CONFIG_FREERTOS_LEGACY_HOOKS 1
#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA 1
#define CONFIG_PYTHON "python"
#define CONFIG_MBEDTLS_ECP_NIST_OPTIM 1
#define CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1 1
#define CONFIG_ESPTOOLPY_COMPRESSED 1
#define CONFIG_PARTITION_TABLE_FILENAME "partition-table.csv"
#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 1
#define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32
#define CONFIG_ESP32_WIFI_RX_BA_WIN 6
#define CONFIG_MBEDTLS_X509_CSR_PARSE_C 1
#define CONFIG_SPIFFS_USE_MTIME 1
#define CONFIG_NIMBLE_HCI_EVT_HI_BUF_COUNT 30
#define CONFIG_SW_COEXIST_PREFERENCE_VALUE 2
#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA 1
#define CONFIG_MBEDTLS_DEBUG 1
#define CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE 2048
#define CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V 1
#define CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY 2000
#define CONFIG_BROWNOUT_DET_LVL 0
#define CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_PCM 1
#define CONFIG_MBEDTLS_PEM_PARSE_C 1
#define CONFIG_SPIFFS_GC_MAX_RUNS 10
#define CONFIG_ESP32_APPTRACE_DEST_NONE 1
#define CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC 1
#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 1
#define CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA 1
#define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM 64
#define CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED 1
#define CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED 1
#define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 160
#define CONFIG_MBEDTLS_HARDWARE_AES 1
#define CONFIG_FREERTOS_HZ 100
#define CONFIG_LOG_COLORS 1
#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1
#define CONFIG_STACK_CHECK_NONE 1
#define CONFIG_ADC_CAL_EFUSE_TP_ENABLE 1
#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1
#define CONFIG_BROWNOUT_DET 1
#define CONFIG_ESP32_XTAL_FREQ 40
#define CONFIG_MONITOR_BAUD_115200B 1
#define CONFIG_LOG_BOOTLOADER_LEVEL 3
#define CONFIG_MBEDTLS_TLS_ENABLED 1
#define CONFIG_NIMBLE_ROLE_PERIPHERAL 1
#define CONFIG_MBEDTLS_SSL_SESSION_TICKETS 1
#define CONFIG_SPIFFS_MAX_PARTITIONS 3
#define CONFIG_ESP_ERR_TO_NAME_LOOKUP 1
#define CONFIG_MBEDTLS_SSL_RENEGOTIATION 1
#define CONFIG_ESPTOOLPY_BEFORE_RESET 1
#define CONFIG_NIMBLE_ACL_BUF_COUNT 12
#define CONFIG_ESPTOOLPY_BAUD_OTHER_VAL 115200
#define CONFIG_WARN_WRITE_STRINGS 1
#define CONFIG_SPIFFS_OBJ_NAME_LEN 32
#define CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT 6
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_ESPTOOLPY_AFTER "hard_reset"
#define CONFIG_ESP32_XTAL_FREQ_40 1
#define CONFIG_FREERTOS_INTERRUPT_BACKTRACE 1
#define CONFIG_WL_SECTOR_SIZE 4096
#define CONFIG_ESP32_DEBUG_OCDAWARE 1
#define CONFIG_TIMER_TASK_PRIORITY 5
#define CONFIG_MBEDTLS_TLS_CLIENT 1
#define CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI 1
#define CONFIG_NIMBLE_GAP_DEVICE_NAME_MAX_LEN 31
#define CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_EFF 1
#define CONFIG_BT_ENABLED 1
#define CONFIG_SW_COEXIST_PREFERENCE_BALANCE 1
#define CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED 1
#define CONFIG_MONITOR_BAUD 115200
#define CONFIG_ESP32_DEBUG_STUBS_ENABLE 1
#define CONFIG_BOOTLOADER_WDT_TIME_MS 60000
#define CONFIG_FREERTOS_CORETIMER_0 1
#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partition-table.csv"
#define CONFIG_MBEDTLS_HAVE_TIME 1
#define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1
#define CONFIG_ADC_CAL_EFUSE_VREF_ENABLE 1
#define CONFIG_MBEDTLS_TLS_SERVER 1
#define CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT 1
#define CONFIG_FREERTOS_ISR_STACKSIZE 1536
#define CONFIG_OPENSSL_ASSERT_DO_NOTHING 1
#define CONFIG_IDF_TARGET "esp32"
#define CONFIG_NIMBLE_ENABLED 1
#define CONFIG_WL_SECTOR_SIZE_4096 1
#define CONFIG_OPTIMIZATION_LEVEL_DEBUG 1
#define CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED 1
#define CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED 1
#define CONFIG_FREERTOS_UNICORE 1
#define CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED 1
#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA 1
#define CONFIG_SYSTEM_EVENT_QUEUE_SIZE 32
#define CONFIG_NIMBLE_NVS_PERSIST 1
#define CONFIG_ESP32_WIFI_TX_BUFFER_TYPE 1
#define CONFIG_SUPPORT_STATIC_ALLOCATION 1
#define CONFIG_ESPTOOLPY_BAUD_921600B 1
#define CONFIG_BOOTLOADER_WDT_ENABLE 1
#define CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED 1
#define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1
#define CONFIG_SPIFFS_PAGE_SIZE 256
#define CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED 1
#define CONFIG_NIMBLE_ACL_BUF_SIZE 255
#define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT 3072
#define CONFIG_MONITOR_BAUD_OTHER_VAL 115200
#define CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF 1
#define CONFIG_ESPTOOLPY_PORT "COM3"
#define CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS 1
#define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1
#define CONFIG_ESP32_WIFI_IRAM_OPT 1
sarenameas commented 4 years ago

Hello Sumit,

I noticed you increased the TLS fragment length:

#define CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN 16384

This is double the size that Amazon FreeRTOS tests with. Is there a business need for this update? If there is not, I would recommend using all of the default mbedtls settings by undoing your changes to sdkconfig.

Also my other question has not been answered. Did you reach the vApplicationStackOverflowHook() when you set a break point in there?

Unfortunately the mbedtls logs can lag behind the application. To get exact error information at which part in the handshake we will need to insert a loop before your application ends:

while(1)
{
    vTaskDelay( 1000 );
}

And keep running until all of the mbedtls logs to to the handshake error have finished. There is no need to keep playing with the stack size.

Also on another note, some platforms can only support one MQTT connection active a time. Please make sure you only have ONE connection at a time in the system.

sumit612 commented 4 years ago

I got the issue.


it was by default in the Kconfig in this directory "amazon-freertos\vendors\espressif\boards\esp32\aws_demos\application_code\espressif_code\mbedtls"
qiutongs commented 4 years ago

Please open a new issue and close this one.