#41489 [NEW]: stream_select don't work on ssl stream_socket_server
| From: | n dot escuder at intra-links dot com | Date: | Thu, 24 May 2007 13:09:30 +0000 |
| Subject: | #41489 [NEW]: stream_select don't work on ssl stream_socket_server | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-112994@lists.php.net to get a copy of this message | ||
From: n dot escuder at intra-links dot com
Operating system: Linux 2.6
PHP version: 5.2.2
PHP Bug Type: Streams related
Bug description: stream_select don't work on ssl stream_socket_server
Description:
------------
When creating an socket server in ssl mode stream_select don't work.
In PHP 5.2.1 all work fine the bug is in PHP 5.2.2.
Reproduce code:
---------------
server.php:
$options = array( "ssl" => array( "allow_self_signed" => true,
"verify_peer" => false, "local_cert" =>
"/www/conf/ssl/server.pem" ) );
$context = stream_context_create();
stream_context_set_option( $context, $options );
$s = stream_socket_server( "ssl://0.0.0.0:6310", $errno, $errstr,
STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context );
while ( 1 ) {
$read = array( $s );
$wr = null;
$ed = null;
if ( stream_select( $read, $wr, $ed, 0, 500 ) > 0 ) {
echo "ACCEPT\n";
}
}
client.php:
$s = stream_socket_client( "ssl://localhost:6310" );
$s->write("toto\r\n\r\n");
sleep( 1 );
Expected result:
----------------
when running server.php we must go "ACCEPT" onto the screen.
Actual result:
--------------
nothing
--
Edit bug report at http://bugs.php.net/?id=41489&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41489&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41489&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41489&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41489&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41489&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41489&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41489&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41489&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41489&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41489&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41489&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41489&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41489&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41489&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41489&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41489&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41489&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41489&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41489&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41489&r=mysqlcfg