Page 1 of 1

esp_tls_conn_read bad data

Posted: Wed Jan 26, 2022 7:15 am
by campestring
Hello everyone,
I have trouble with https request,
I have bad data sometimes between buffer read.

len = sizeof(buf) - 1;
memset(buf, 0, sizeof(buf));
ret = esp_tls_conn_read(tls, (char *)buf, len);

I am trying to received a binary file for ota. but sometimes ret < len and I have bad data the next read so my binary is corrupted...
Any idea ? it looks like the error appears at the same place each time. If I copy paste my request in a browser the file is downloaded correctly...
Have a good day.
Arnaud

Re: esp_tls_conn_read bad data

Posted: Thu Feb 03, 2022 4:12 pm
by ESP_Mahavir
Could you please share your application code? Please take a look at https://github.com/espressif/esp-idf/bl ... ple_main.c as starting point here.

Re: esp_tls_conn_read bad data

Posted: Wed Mar 16, 2022 7:49 am
by campestring
Thank you I solved the problem, the problem came from the server not the ESP32. Have a good day !