SSLClient icon indicating copy to clipboard operation
SSLClient copied to clipboard

Cannot operate on a closed SSL connection

Open radu-bethub opened this issue 3 years ago • 3 comments
trafficstars

I'm getting

13:17:55.152 > (SSLClient)(SSL_ERROR)(available): Cannot operate on a closed SSL connection. 13:17:55.152 > (SSLClient)(SSL_ERROR)(m_print_br_error): Incoming record is too large to be processed, or buffer is too small for the handshake message to send.

while trying to get my firmware bin file.

EthernetClient ClientESP; SSLClient clientESP(ClientESP, TAs, (size_t)TAs_NUM, 25); HttpClient clientHttp = HttpClient(clientESP, server, 443);

any idea? my GET server address is hosted on cloudflare.

radu-bethub avatar Mar 29 '22 11:03 radu-bethub

This error is likely occurring because SSLClient's internal buffer is too small to fit the entire firmware file. You can try increasing the buffer size by increasing the size of the following array in your copy of SSLClient: https://github.com/OPEnSLab-OSU/SSLClient/blob/1fe48948004a3ad52705ab26db4f65833ecb4e12/src/SSLClient.h#L469 If that doesn't work, you can also try this other SSLClient that dynamically allocates memory and should handle large records better: https://github.com/govorox/SSLClient

prototypicalpro avatar Mar 29 '22 19:03 prototypicalpro

well done @prototypicalpro. I managed to increase the buffer directly from library for testing and now the update OTA is working well. I will continue to work in order to don't alter the library directly and increase that variable from my env. thanks a lot for you help.

radu-bethub avatar Mar 29 '22 20:03 radu-bethub