From: ่ฎธไบ‘ Subject: [BUG] LibreSSL/OpenSSL client fails to decrypt large back-to-back TLS records To: tech@openbsd.org Date: Sat, 19 Jul 2025 09:59:48 +0800 Hello LibreSSL developers, Iโ€™d like to report a reproducible TLS bug involving LibreSSL or OpenSSL clients when receiving large encrypted records from a TLS 1.3 server. ๐Ÿ› Description When the server sends multiple large SSL_write() calls back-to-back โ€” each sending about 3MB of data โ€” the client (LibreSSL or OpenSSL) fails to decrypt after receiving the first 2 or 3 records. This happens only when the data is sent without delay. If a sleep(2) is added between writes, the issue disappears. This suggests that the client fails to handle TCP coalesced (sticky) packets, where two TLS records arrive merged in one recv(). โœ… Works with wolfSSL client Using a wolfSSL client, the same test works perfectly โ€” no errors, even with high-throughput record streams and no delay between writes. The issue only appears with LibreSSL or OpenSSL clients acting as receivers. ๐Ÿงช Reproduction Project (OpenSSL-based) A test project is available here: ๐Ÿ”— https://github.com/xuyun018/openssl_bug_linux It includes: A TLS client and server program (using OpenSSL APIs โ€” LibreSSL compatible) The server sends a large file (AA.bmp, >3MB) using multiple SSL_write() calls No delay between writes LibreSSL clients will fail after a few chunks. โ–ถ Test Instructions Place AA.bmp (size > 3MB), server-cert.pem, and server-key.pem in the same directory as the binary Build with LibreSSL or OpenSSL Run as: Server: ./program [server-cert.pem] [server-key.pem] Client: ./program With LibreSSL client, youโ€™ll get a decryption error after receiving ~2โ€“3 records. ๐Ÿ™ Request It seems the TLS record layer in LibreSSL (and possibly OpenSSL) does not properly handle consecutive large records arriving in a single TCP packet. I hope the LibreSSL team can take a look โ€” happy to assist with more testing if needed. Best regards, xuyun018