### Summary
TLS 1.3 client hello error.
I'm using LWIP ALTCP over MBEDTLS, w…hich uses mbedtls for the TLS functionalities, as I'm porting over got errors with unknown cause to me with activating only TLS 1.2, then tried to activate TLS 1.3 and see whether problems occurs and I just received an earlier error prior the error I'm looking to solve.
The previous working code had mbedtls version 2.28.3, ESP-IDF v4.4.5, lwip 2.1.2, and GCC 8.4, now there're major released of each library, including mbedtls.
- mbedtls 3.4.0
- ESP-IDF 5.1
- lwip 2.1.3
- GCC 12.2
### System information
Mbed TLS version (number or commit id): 3.4.0
Operating system and version: ESP-IDF v5.1
Platform: ESP32-S3
Attached is the sdkconfig.h file with mbedtls related configs.
### Expected behavior
### Actual behavior
```
/IDF/components/mbedtls/mbedtls/library/ssl_tls.c:3859: client state: MBEDTLS_SSL_HELLO_REQUEST
mbedtls_ssl_handshake_step (over=0)
/IDF/components/mbedtls/mbedtls/library/ssl_msg.c:2124: => flush output
/IDF/components/mbedtls/mbedtls/library/ssl_msg.c:2133: <= flush output
/IDF/components/mbedtls/mbedtls/library/ssl_tls.c:3859: client state: MBEDTLS_SSL_CLIENT_HELLO
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0906: => write client hello
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0480: dumping 'client hello, random bytes' (32 bytes)
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0480: 0000: 22 26 8c 35 1f fb 04 60 9d 6d 65 62 94 dd 32 37 "&.5...`.meb..27
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0480: 0010: 46 07 35 da 7c 93 5a 28 e2 34 02 f5 bc d0 37 6d F.5.|.Z(.4....7m
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0505: dumping 'session id' (32 bytes)
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0505: 0000: 22 c0 96 4c ee 88 0e 25 4f 53 dd 24 e8 4a 01 73 "..L...%OS.$.J.s
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0505: 0010: f9 57 a4 3e 87 f8 f4 53 dc 1a 94 dd 63 4e 8d 54 .W.>...S....cN.T
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 1302, TLS1-3-AES-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 1301, TLS1-3-AES-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 1304, TLS1-3-AES-128-CCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 1305, TLS1-3-AES-128-CCM-8-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c02c, TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c030, TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c0ad, TLS-ECDHE-ECDSA-WITH-AES-256-CCM
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c024, TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c028, TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c00a, TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c014, TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c0af, TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c087, TLS-ECDHE-ECDSA-WITH-CAMELLIA-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c08b, TLS-ECDHE-RSA-WITH-CAMELLIA-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c073, TLS-ECDHE-ECDSA-WITH-CAMELLIA-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c077, TLS-ECDHE-RSA-WITH-CAMELLIA-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c05d, TLS-ECDHE-ECDSA-WITH-ARIA-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c061, TLS-ECDHE-RSA-WITH-ARIA-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c049, TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c04d, TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c02b, TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c02f, TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c0ac, TLS-ECDHE-ECDSA-WITH-AES-128-CCM
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c023, TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c027, TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c009, TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c013, TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c0ae, TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c086, TLS-ECDHE-ECDSA-WITH-CAMELLIA-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c08a, TLS-ECDHE-RSA-WITH-CAMELLIA-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c072, TLS-ECDHE-ECDSA-WITH-CAMELLIA-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c076, TLS-ECDHE-RSA-WITH-CAMELLIA-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c05c, TLS-ECDHE-ECDSA-WITH-ARIA-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c060, TLS-ECDHE-RSA-WITH-ARIA-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c048, TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c04c, TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 009d, TLS-RSA-WITH-AES-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c09d, TLS-RSA-WITH-AES-256-CCM
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 003d, TLS-RSA-WITH-AES-256-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 0035, TLS-RSA-WITH-AES-256-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c032, TLS-ECDH-RSA-WITH-AES-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c02a, TLS-ECDH-RSA-WITH-AES-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c00f, TLS-ECDH-RSA-WITH-AES-256-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c02e, TLS-ECDH-ECDSA-WITH-AES-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c026, TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c005, TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c0a1, TLS-RSA-WITH-AES-256-CCM-8
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c07b, TLS-RSA-WITH-CAMELLIA-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 00c0, TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 0084, TLS-RSA-WITH-CAMELLIA-256-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c08d, TLS-ECDH-RSA-WITH-CAMELLIA-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c079, TLS-ECDH-RSA-WITH-CAMELLIA-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c089, TLS-ECDH-ECDSA-WITH-CAMELLIA-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c075, TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c05f, TLS-ECDH-ECDSA-WITH-ARIA-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c063, TLS-ECDH-RSA-WITH-ARIA-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c051, TLS-RSA-WITH-ARIA-256-GCM-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hHello, add ciphersuite: c04b, TLS-ECDH-ECDSA-WITH-ARIA-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c04f, TLS-ECDH-RSA-WITH-ARIA-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c03d, TLS-RSA-WITH-ARIA-256-CBC-SHA384
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 009c, TLS-RSA-WITH-AES-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c09c, TLS-RSA-WITH-AES-128-CCM
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 003c, TLS-RSA-WITH-AES-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 002f, TLS-RSA-WITH-AES-128-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c031, TLS-ECDH-RSA-WITH-AES-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c029, TLS-ECDH-RSA-WITH-AES-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c00e, TLS-ECDH-RSA-WITH-AES-128-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c02d, TLS-ECDH-ECDSA-WITH-AES-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c025, TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c004, TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c0a0, TLS-RSA-WITH-AES-128-CCM-8
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c07a, TLS-RSA-WITH-CAMELLIA-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 00ba, TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: 0041, TLS-RSA-WITH-CAMELLIA-128-CBC-SHA
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c08c, TLS-ECDH-RSA-WITH-CAMELLIA-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c078, TLS-ECDH-RSA-WITH-CAMELLIA-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c088, TLS-ECDH-ECDSA-WITH-CAMELLIA-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c074, TLS-ECDH-ECDSA-WITH-CAMELLIA-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c05e, TLS-ECDH-ECDSA-WITH-ARIA-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c062, TLS-ECDH-RSA-WITH-ARIA-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c050, TLS-RSA-WITH-ARIA-128-GCM-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c04a, TLS-ECDH-ECDSA-WITH-ARIA-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c04e, TLS-ECDH-RSA-WITH-ARIA-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0363: client hello, add ciphersuite: c03c, TLS-RSA-WITH-ARIA-128-CBC-SHA256
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0381: adding EMPTY_RENEGOTIATION_INFO_SCSV
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0390: client hello, got 85 cipher suites
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0054: client hello, adding server name extension: 192.168.1.34
/IDF/components/mbedtls/mbedtls/library/ssl_tls13_client.c:0062: client hello, adding supported versions extension
/IDF/components/mbedtls/mbedtls/library/ssl_tls13_client.c:0085: supported version: [3:4]
/IDF/components/mbedtls/mbedtls/library/ssl_tls13_client.c:0091: supported version: [3:3]
/IDF/components/mbedtls/mbedtls/library/ssl_tls13_client.c:0569: no cookie to send; skip extension
/IDF/components/mbedtls/mbedtls/library/ssl_tls13_client.c:0285: client hello: adding key share extension
/IDF/components/mbedtls/mbedtls/library/ssl_tls13_generic.c:1471: Perform PSA-based ECDH computation.
/IDF/components/mbedtls/mbedtls/library/ssl_tls13_generic.c:1493: psa_generate_key() returned -27648 (-0x6c00)
/IDF/components/mbedtls/mbedtls/library/ssl_client.c:0994: <= write client hello
mbedtls_ssl_handshake_step (over=0)
mbedtls_ssl_handshake failed: -27648 (ffff9400)
```
### Steps to reproduce
### Additional information
Is there any issue with the attached configurations? or missing parts?
Regards,
Hamza Hajeir
[sdkconfig.txt](https://github.com/Mbed-TLS/mbedtls/files/13063996/sdkconfig.txt)