By the way, it is much easier to reproduce if you make a page that takes a little longer to render. For example, if you modify the file resources/https/server/https_server_top.html by adding a couple of thousand lines of print (to emulate a page that is rendered dynamically by the CPU), then it is easy to reproduce.
High concurrency could exhaust the resource of the MCU and hence result in the failure you saw.
Since the code example didn't use multi-threading, the result is expected to be worse facing high concurrency.
The code is provided for demonstration and is not intended to cover high concurrency situation. You can try to improve it by yourself, making the improvements at your need.
Sincere regards from C. L.
Thank you. By inserting delays in ssl_tls.c, I observe that it is more robust against this condition. I will keep testing and report back.
Update: I have been pounding the webserver for a few days and it seems to be stable. No hanging. I suspect you were correct in saying the system resources were being exhausted. Perhaps the malloc's built-up quickly until there was no memory left. By adding delays as indicated, the peak malloc's likely no longer reach the point of exhaustion. So, case closed. Thanks for your help on this.