Fix build on Arduino ESP32 v3.0.0 and IDF 5.1.1
This fixes compilation on the latest Git version of the Arduino ESP32 core due to API changes in IDF 5.1.
Of course, these changes make ESPAsyncWebServer incompatible with prior Arduino core versions.
@blackhack Any way we can use a compiler flag to detect old ESP32 arduino core? I think we should look into making it backwards-compatible.
Just as a drive-by review that will hopefully help get this PR unstuck, consider bracketing the new changes (probably really only the changed mbedtls symbol names) inside #if ESP_ARDUINO_VERSION_MAJOR > 2 or something like that. If you want to minimize the changes in the .cpp files and torment the souls of developers for generations to come, you could do something really gross like
#if ESP_ARDUINO_VERSION_MAJOR > 2 #defien mbedtls_sha1_starts_ret mbedtls_sha1_starts ... others continue.
That's pretty gross, but it would at least minimize the footprint of the conditionals.
I think the basic recipe is just to include esp_arduino_version.h and test ESP_ARDUINO_VERSION_MAJOR and close friends.
I don't have any (qualified) opinion on whether that test is >2 or >= 3 or ESP_ARDUINO_VERSION for the whole number or something else. There are options: See approximately this, but skim the whole file for ideas to harvest:
https://github.com/espressif/arduino-esp32/blob/0a47f34b34a64986417de3b38622b607a001a489/cores/esp32/esp_arduino_version.h#L21-L26
Thanks and good luck!