From: jerrywilborn at gmail dot com Operating system: CentOS 4.4 PHP version: 5.2.10 PHP Bug Type: Streams related Bug description: stream_socket_enable_crypto problems outside of child process
Description: ------------ Open a tcp connection using stream_socket_client, spawn a child process with pcntl_fork, encrypt the stream in the child, fetch data from the stream. In the parent wait for the child to finish and then fetch data out of the stream; it is not decrypted. Reproduce code: --------------- <? $s = stream_socket_client("tcp://smtpout.secureserver.net:465", $errno, $errstr, 5, STREAM_CLIENT_CONNECT); if (!pcntl_fork()) { if (stream_socket_enable_crypto($s, TRUE, STREAM_CRYPTO_METHOD_SSLv23_CLIENT)) { print "child: " . fgets($s); } exit; } pcntl_wait($status); print "parent: " . fgets($s) . "\n"; ?> Expected result: ---------------- child: 220 smtpauth18.prod.mesa1.secureserver.net ESMTP parent: 220 smtpauth18.prod.mesa1.secureserver.net ESMTP Actual result: -------------- child: 220 smtpauth18.prod.mesa1.secureserver.net ESMTP parent: ??1)?????cV^~????? ??n?0?s`wh?9 -- Edit bug report at http://bugs.php.net/?id=49257&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49257&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49257&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49257&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49257&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49257&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49257&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49257&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49257&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49257&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49257&r=support Expected behavior: http://bugs.php.net/fix.php?id=49257&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49257&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49257&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49257&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49257&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49257&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49257&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49257&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49257&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49257&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49257&r=mysqlcfg