OpenSSL sending data problem

I implemented a project using esp8266-rtos-sdk and i use OpenSSL in my project。Esp8266 long connection with server, and the server sends heartbeat packets to the esp8266 client every 10 seconds.However, after a period of time, the server cannot receive the reply from the client, but the client can still receive the data. If the server cannot receive three reply packets in a row, it will disconnect the connection of the client.This phenomenon may be answered dozens of times, hundreds of times, thousands of times, in short, this number is random.Esp8266 memory was reduced by about 3K when the server received no reply.And esp8266 queries the state of SSL, which is still connected.
I wonder if this is a bug of the openssl library?

Can you create a firmware and server in which this behaviour is reproducable?

I have uploaded a test demo to github:https://github.com/GarMingLi/esp8266_websocket.git
I also used this demo to test before, and the problem was repeated every time.This is a websocket demo that calls the openssl function.

In order to support OpenSSL, I modified the contents of “esp8266-rtos-sdk.py” file under ".platformio\platforms\espressif8266\builder\frameworks"path:

CPPPATH=[
join(FRAMEWORK_DIR, “include”),
join(FRAMEWORK_DIR, “extra_include”),
join(FRAMEWORK_DIR, “driver_lib”, “include”),
join(FRAMEWORK_DIR, “include”, “espressif”),
join(FRAMEWORK_DIR, “include”, “lwip”),
join(FRAMEWORK_DIR, “include”, “lwip”, “ipv4”),
join(FRAMEWORK_DIR, “include”, “lwip”, “ipv6”),
join(FRAMEWORK_DIR, “include”, “nopoll”),
join(FRAMEWORK_DIR, “include”, “spiffs”),
join(FRAMEWORK_DIR, “include”, “json”),
join(FRAMEWORK_DIR, “include”, “mbedtls”),
join(FRAMEWORK_DIR, “include”, “openssl”),
],

LIBS=[
“cirom”, “crypto”, “driver”, “espconn”, “espnow”, “freertos”, “gcc”,
“json”, “hal”, “lwip”, “main”, “mesh”, “mirom”, “net80211”, “nopoll”,
“phy”, “pp”, “pwm”, “smartconfig”, “spiffs”, “wpa”, “wps”,“openssl”,“mbedtls”,
],

My purpose is to implement wss-mode websocket, so I need to use SSL functionality.In the beginning, I used the library of nopoll, but found that I could not use WSS mode normally, so I transplanted a websocket library and implemented WSS mode with openssl. The result was that there was such a problem in sending data from openssl during the test.

Did you reproduce the problem I described?