ID: 49295
Updated by: pajoye@php.net
Reported By: frase at cs dot wisc dot edu
-Status: Open
+Status: Feedback
Bug Type: OpenSSL related
Operating System: win32 only - Win 2000 Pro SP4
PHP Version: 5.2.11RC2
-Assigned To:
+Assigned To: srinatar
New Comment:
Having read the backlog, will you work on that or completely give up on
this bug (saw that you unassigned this bug)?
Previous Comments:
------------------------------------------------------------------------
[2009-09-16 18:22:57] srinatar@php.net
as i mentioned to you last time, our openssl implementation is
incorrectly using file based sockets instead of openssl provided 'BIO'
for underlying communication. this will require re-implementation of
some of php's openssl implementation.
this should be an issue only on windows.
------------------------------------------------------------------------
[2009-09-04 13:21:10] frase at cs dot wisc dot edu
I'm sure this is expected, but the bug remains in 5.2.11RC2.
I also noticed another clue: I mentioned previously that SSL+ASYNC
works once (but not asynchronously) after starting Apache, and then
fails and throws warnings. It turns out any SSL socket connection will
cause future SSL+ASYNC attempts to do this, even if the first one was
SYNC. So to get SSL+ASYNC to connect, it must be the very first SSL
socket opened since Apache started.
------------------------------------------------------------------------
[2009-09-02 14:17:18] frase at cs dot wisc dot edu
Commenting the stream_set_blocking() doesn't change anything for me on
Windows. SSL+ASYNC still works exactly once (but doesn't actually
connect asynchronously) and then gives the warnings; SSL+SYNC still
works fine, as does TCP+ASYNC.
Thanks for your work on this. I get complaints about it every week
because if the remote server doesn't respond then our software gets
stuck in the connection phase, and since the connection phase cannot be
made asynchronous, the user is unable to abort it and just has to wait.
------------------------------------------------------------------------
[2009-09-02 08:38:01] srinatar@php.net
just a follow up note, this issue (async not working consistently with
openssl on windows) has always been the case and this issue has nothing
to do with the fix that went in for bug:48182.
------------------------------------------------------------------------
[2009-09-02 08:09:22] srinatar@php.net
ok, i was looking into this issue today. the issue is that ,
especially on windows -where sockets are not file descriptors unlike
in unix, async sockets and openssl works together only if we use BIO
wrappers provided by openssl module instead of directly accessing
underlying sockets as file descriptors.
the possible right way to do this would be to use to socket wrappers
provided by SSL module (known as BIO wrappers which makes it work
properly on windows).
this will require some amount of fiddling our openssl module. i don't
think, 5.2 is a good place to do this change.
for now, commenting this below code should help you to run your script
properly on windows.
stream_set_blocking($socket, 0);
i will spend more time on this and investigate on the best way to use
BIO wrappers within existing openssl module say within php 5.3
------------------------------------------------------------------------
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
http://bugs.php.net/49295--
Edit this bug report at http://bugs.php.net/?id=49295&edit=1