ID:               49295
 Updated by:       srina...@php.net
 Reported By:      frase at cs dot wisc dot edu
 Status:           Assigned
 Bug Type:         OpenSSL related
 Operating System: Win 2000 Pro SP4
 PHP Version:      5.2.11RC2
 Assigned To:      srinatar
 New Comment:

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. 


Previous Comments:
------------------------------------------------------------------------

[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] srina...@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] srina...@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

------------------------------------------------------------------------

[2009-08-21 15:05:47] frase at cs dot wisc dot edu

I had a chance to compile and test PHP5.2.11RC1 under Linux this
morning (Ubuntu Jaunty, Apache 2.2.11 from repositories), and these
warnings do not appear, however I noticed another problem.

Although the SSL+async connection is successful and data is returned
under Linux, the socket is not actually opened asynchonously.  The
script blocks until the socket has finished opening, exactly as it does
without the ASYNC flag.  This is also true under Windows, for the first
run -- after that, of course, it returns the errors posted above.

------------------------------------------------------------------------

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

Reply via email to