It looks like there is currently a bug in PHP: https://bugs.php.net/bug.php?id=72333 As a temporary solution we could try to limit fwrite data length to 4096 of 8192 bytes, like suggested here: http://stackoverflow.com/questions/14695247/in-php-openssl-error-messages-error-1409f07f-ssl-routines-ssl3-write-pendin