Bug #65137 [ReO]: stream_select misleads when TLS socket is used
| From: | rdlowrey@php.net | Date: | Fri, 06 Mar 2015 17:35:40 +0000 |
| Subject: | Bug #65137 [ReO]: stream_select misleads when TLS socket is used | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191221@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65137&edit=1
ID: 65137
Updated by: rdlowrey@php.net
Reported by: boen dot robot at gmail dot com
Summary: stream_select misleads when TLS socket is used
Status: Re-Opened
Type: Bug
Package: Streams related
Operating System: Windows Server 2008 R2
PHP Version: 5.5.0
Assigned To: rdlowrey
Block user comment: N
Private report: N
New Comment:
Windows snapshots should be available sometime in the next few hours here:
http://windows.php.net/downloads/snaps/php-5.6/
The commit to fix this was added after the final March 05 snapshot. As soon as a newer snapshot is
available you should be able to download a usable windows binary to test. In my own tests this
latest commit resolves the issue from the client/server test case in the related bug #68853.
Previous Comments:
------------------------------------------------------------------------
[2015-03-06 01:15:13] boen dot robot at gmail dot com
Thank you.
I don't have the setup (or know-how) to compile PHP myself, especially on Windows. If there
were snapshot builds, I'd gladly test this, as well as the related #68853.
I guess I'll just have to wait for... 5.6.8 or whenever a release with that fix in it emerges,
and report back then, if there are new issues.
(Considering how long this has been an issue, I don't mind...)
------------------------------------------------------------------------
[2015-03-06 01:02:35] rdlowrey@php.net
I have cherry-picked @DaveRandom's original SSL_pending() solution back into 5.6 and master.
I'm fairly certain this commit solves the problem fully. It was unfortunately reverted due to
its close proximity to some other buggy shenanigans.
This change will *not* appear in the forthcoming 5.6.7 release so that we have time to test, get
feedback and verify that it works everywhere. If you're interested in this bug's
resolution please build the current PHP-5.6 or master branch to verify that the issue is resolved.
------------------------------------------------------------------------
[2015-02-09 19:28:06] requinix@php.net
https://github.com/php/php-src/commit/7b8222aa44bbab9928afd57adb1bc04cf291d46c
------------------------------------------------------------------------
[2015-02-09 13:38:58] sjaillet at gmail dot com
Is it possible have the status of this bug updated ? Thanks !
------------------------------------------------------------------------
[2014-12-22 14:00:41] boen dot robot at gmail dot com
I'd like to point out that this issue is still not resolved, as daverandom's fix was
reverted due to the related issue askalski points to.
(So... the status shouldn't really be "Closed"...)
IMHO, that fix, while POTENTIALLY bad for performance (in SOME cases...), is better than no fix at
all, because encrypted sockets are almost impossible to work with otherwise. When people use an
encrypted connection, they are ready to sacrifice a little performance anyway.
A proper fix, I think, would involve a modification in PHP's stream API, where instead of just
PHP_STREAM_AS_FD_FOR_SELECT, there would be PHP_STREAM_AS_FD_FOR_SELECT_READ,
PHP_STREAM_AS_FD_FOR_SELECT_WRITE and PHP_STREAM_AS_FD_FOR_SELECT_OOB, allowing the OpenSSL
extension (and potentially other streams) to flush the appropriate buffers, as opposed to
"all" buffers, which is what the current fix is doing. The PHP_STREAM_AS_FD_FOR_SELECT
constant could be modified to be a bitmask that OR's all those new ones, thus minimizing
migration problems.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=65137
--
Edit this bug report at https://bugs.php.net/bug.php?id=65137&edit=1