What does mbed-tls error code -0x3F80 mean?

When you see an error message such as

E (169535) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x3F80

on your microcontroller (e.g. ESP32), this means


In other words, there is not enough memory for mbed-tls to work – specifically, there is not enough memory to allocate the public key. Try to reduce the memory usage of your application.