Hi @KennethSong
Does it means that the input *buf is invaild?
Not necessary. As I asked in my previous comment, have you set the correct CA root certificate in mbedtls_ssl_conf_ca_chain() or mbedtls_ssl_conf_ca_cb()? Have you set the correct hostname?
The error mostly means that the certificate couldn’t be verified using the ca certificates that were set in your application.
But i use the same cert on ESP32 with the same input to this function, and it will not return error. Do you know why?
What same certificate? Device certificate or ca root certificate? It could also be some memory related issue, that caused the verification to fail.
Regards