Hello Everyone,I am using the Renesas RA8M1 i am trying to send the data to my server with the modification made on the example project.I can able to connect to my server and receive the data from my server without any interuption for the first one hour after that i am facing the NO LOW CODE in the ethernet after this error occured i tried to disconnect and connect to my server and send the data again but i couldn’t able to connect it my server doesn’t have any certificate verfication so i had skipped all the certificate verification in the code.Can anyone help me to overcome this problem.
Is there a chance it’s related to this bug reported elsewhere (not in the FreeRTOS forum)?
I have tryied using that function while using this function i can’t even able to link up the ethernet.Yes my code fails at the TLS layers trying to figure out what else can be done to avoid this error.
Which TLS stack are you using? Does enabling debug logs for the TLS stack provides any information?
I am using the AWS HTTP core stack for my project.Yes i have added the debug statements while it is connecting to the server i am getting these messages
00> Successfully provisioned the device with client certificate and client key
00> === Establishing Persistent Connection ===
00> [ERR] In Function: connect_aws_https_client(), Failed to connect the server, retrying after 3000 ms.
00> [TLS_INFO] === TLS Setup Started ===
00> [TLS_DEBUG] Host: (Host Name)
00> [TLS_DEBUG] Network Context: 22042554
00> [TLS_DEBUG] Network Credentials: 22041248
00> [TLS_DEBUG] TLS Transport Params: 22040D50
00> [TLS_DEBUG] Initializing SSL context…
00> [TLS_DEBUG] SSL context initialized successfully
00> [TLS_DEBUG] Setting SSL config defaults…
00> [TLS_DEBUG] SSL config defaults set successfully
00> [TLS_DEBUG] Initializing PSA Crypto…
00> [TLS_DEBUG] PSA Crypto initialized successfully
00> [TLS_INFO] Setting SSL auth mode to NONE (skipping certificate verification)
00> [TLS_DEBUG] SSL auth mode set to VERIFY_NONE
00> [TLS_DEBUG] Setting RNG context…
00> [TLS_DEBUG] RNG context set successfully
00> [TLS_INFO] Certificate verification disabled - connecting without certificate validation
00> [TLS_DEBUG] ALPN configuration skipped (no ALPN protocols provided)
00> [TLS_DEBUG] Setting up SSL context…
00> [TLS_DEBUG] SSL context setup successful
00> [TLS_DEBUG] Setting BIO callbacks…
00> [TLS_DEBUG] TCP Socket: 22005200
00> [TLS_DEBUG] BIO callbacks set successfully
00> [TLS_DEBUG] Setting SNI hostname: (Host Name)
00> [TLS_DEBUG] SNI hostname set successfully
00> [TLS_DEBUG] Maximum fragment length extension not enabled
00> [TLS_INFO] === Starting TLS Handshake ===
00> [TLS_DEBUG] Performing TLS handshake…
00> [TLS_DEBUG] Handshake attempt 1
00> [TLS_INFO] Handshake successful after 1 attempts
00> [TLS_INFO] === TLS Handshake Completed Successfully ===
00> [TLS_DEBUG] TLS Version: TLSv1.2
00> [TLS_DEBUG] Cipher Suite: TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
00> [TLS_INFO] === TLS Setup Completed Successfully ===
00> [TLS_DEBUG] Network connection: 22042554
00> [TLS_INFO] === TLS Setup Finished with status: 0 ===
00>
00> Connected to the server
00> Persistent connection established successfully
When it is failling i am getting the Logs as
00> [TLS_INFO] === TLS Setup Started ===
00> [TLS_DEBUG] Host: (Host Name)
00> [TLS_DEBUG] Network Context: 22042554
00> [TLS_DEBUG] Network Credentials: 22041248
00> [TLS_DEBUG] TLS Transport Params: 22040D50
00> [TLS_DEBUG] Initializing SSL context…
00> [TLS_DEBUG] SSL context initialized successfully
00> [TLS_DEBUG] Setting SSL config defaults…
00> [TLS_DEBUG] SSL config defaults set successfully
00> [TLS_DEBUG] Initializing PSA Crypto…
00> [TLS_DEBUG] PSA Crypto initialized successfully
00> [TLS_INFO] Setting SSL auth mode to NONE (skipping certificate verification)
00> [TLS_DEBUG] SSL auth mode set to VERIFY_NONE
00> [TLS_DEBUG] Setting RNG context…
00> [TLS_DEBUG] RNG context set successfully
00> [TLS_INFO] Certificate verification disabled - connecting without certificate validation
00> [TLS_DEBUG] ALPN configuration skipped (no ALPN protocols provided)
00> [TLS_DEBUG] Setting up SSL context…
00> [TLS_ERROR] Failed to setup SSL context
00> [TLS_ERROR] mbedTLS Error: High=SSL - Memory allocation failed, Low=
00> [TLS_ERROR] Error code: 0xFFFF8100
00> [TLS_DEBUG] Maximum fragment length extension not enabled
00> [TLS_ERROR] TLS setup failed with status: 5
00> [TLS_DEBUG] Cleaning up SSL context…
00> [TLS_DEBUG] SSL context cleanup completed
00> [TLS_INFO] === TLS Setup Finished with status: 5 ===
Can you please check that and guide me to solve this error
This error message tells you that you are running out of memory. One possibility is that you are leaking any memory in your application? If you are using FreeRTOS heap_4, you can periodically dump heap stats to see if heap memory continues to reduce - FreeRTOS-Kernel/portable/MemMang/heap_4.c at main · FreeRTOS/FreeRTOS-Kernel · GitHub.
Thank You for the Info,I have tried clearing the heap while i am trying to connect again if the server connection is failed.Now I am not facing that issue but the handshake is failing can you help me with this
00> === TLS Setup Started ===
00> HostName: (HOST NAME)
00> NetworkContext: 2200D63C
00> NetworkCredentials: 2200D538
00> TlsTransportParams: 2200D040
00> Initializing SSL context…
00> SSL context initialized successfully
00> Setting SSL config defaults…
00> SSL config defaults set successfully
00> Initializing PSA Crypto…
00> PSA Crypto initialized successfully
00> Setting authentication mode to NONE (certificate verification disabled)
00> Setting RNG context…
00> RNG context set successfully
00> Certificate verification disabled - connecting without certificate validation
00> No ALPN protocols specified - skipping ALPN configuration
00> Setting up SSL context…
00> SSL context setup successful
00> Setting BIO functions for SSL context…
00> TCP Socket: 2200DCE8
00> BIO functions set successfully
00> Setting SNI hostname: (HOST NAME)
00> SNI hostname set successfully
00> Maximum fragment length extension not enabled
00> === Starting TLS Handshake ===
00> Handshake attempt #1
00> Handshake error: 0x00B3 (179) on attempt #1
00> ERROR: TLS handshake failed
00> Final mbedTLS Error Code: 0x00B3 (179)
00> Total handshake attempts: 1
00> TLS setup failed, cleaning up SSL context
00> Final return status: 4
00> TLS setup function returning with status: 4
If i increase the Heap size my duration of device connecting to the server is also increasing this is how i clear my heap vPortFree(resUserBuffer); vPortFree(reqUserBuffer); or do i have to clear the entire heap IF you wanted to see my full code can you tell inform me to upload it
Can you try to see what this error code means in mbedTLS?
I found these error definition in the file I these may the issue
#define MBEDTLS_ERR_OID_BUF_TOO_SMALL -0x000B
#define MBEDTLS_ASN1_BIT_STRING 0x03
Seems like an mbedTLS issue, so you are likely to get better response there. A quick Google search provides the following link which you may find useful: Help needed with standard simple certificates - Crypto and SSL questions - Arm Mbed OS support forum.
Yes okay i will ask them and while i am askin ablut this is my renesas forum they said that “The error code 0x00B3 (179), means MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY and the server has notified that it is closing the connection cleanly by sending a “close notify” alert.” But i have tryied disconnecting and connecting to the server again but i am facing the error during handshake.Thank You
We need to find out why the server is closing connection. Does this happen on the very first connection or does it happen on subsequent connection after first disconnect? You may also consider enabling mbedTLS debug logs.