Bug #74159 [Asn->Csd]: writing a large buffer to non-blocking encrypted streams fails

From: Date: Fri, 24 Feb 2017 03:00:44 +0000
Subject: Bug #74159 [Asn->Csd]: writing a large buffer to non-blocking encrypted streams fails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207535@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74159&edit=1 ID: 74159 Updated by: trowski@php.net Reported by: daverandom@php.net Summary: writing a large buffer to non-blocking encrypted streams fails -Status: Assigned +Status: Closed Type: Bug Package: OpenSSL related Operating System: any PHP Version: Irrelevant Assigned To: trowski Block user comment: N Private report: N New Comment: Automatic comment on behalf of aaron@trowski.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=e9873d9853da2b6153776c2e5ed6858e87f0baa2 Log: Fix bug #74159 Previous Comments: ------------------------------------------------------------------------ [2017-02-24 00:37:30] daverandom@php.net Description: ------------ Attempting to write a large buffer to a non-blocking encrypted stream will fail, as SSL_write() expects to be passed the *exact* same buffer (same ptr addr) for successive calls. Test script: --------------- <?php $fp = stream_socket_client("tcp://lxr.room11.org:443"); stream_set_blocking($fp, false); while (!stream_socket_enable_crypto($fp, true, STREAM_CRYPTO_METHOD_ANY_CLIENT)); var_dump(fwrite($fp, "POST / HTTP/1.1\r\nHost: lxr.room11.org\r\nContent-Type: text/plain\r\nContent-Length: 131072\r\n\r\n")); $data = str_repeat("a", 65536); var_dump(fwrite($fp, $data)); var_dump(fwrite($fp, $data)); var_dump(fwrite($fp, $data)); Expected result: ---------------- No errors Actual result: -------------- error:1409F07F:SSL routines:ssl3_write_pending:bad write retry ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74159&edit=1

« previous php.bugs (#207535) next »