During compiling net_sockets.h was not found. Changed to net.h and it compiled and ran. I used https://github.com/nilp0inter/esp32env as the docker toolchain. Not sure if it is incompatible build environment or if mbedTLS source was changed.