Fix error when sending "large" amounts of data through TLS