#49257 [Bgs]: stream_socket_enable_crypto() problems outside of child process
| From: | jerrywilborn at gmail dot com | Date: | Wed, 02 Sep 2009 19:24:33 +0000 |
| Subject: | #49257 [Bgs]: stream_socket_enable_crypto() problems outside of child process | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-141872@lists.php.net to get a copy of this message | ||
ID: 49257
User updated by: jerrywilborn at gmail dot com
Reported By: jerrywilborn at gmail dot com
Status: Bogus
Bug Type: Streams related
Operating System: CentOS 4.4
PHP Version: 5.2.10
New Comment:
I assumed the encryption was a feature of the socket and not the
process. Thanks for the clarification.
Previous Comments:
------------------------------------------------------------------------
[2009-09-02 19:20:54] jani@php.net
Exactly why would it be? You forked and called the crypto enabling, you
didn't enable it for the parent.
------------------------------------------------------------------------
[2009-08-14 17:40:28] jerrywilborn at gmail dot com
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 this bug report at http://bugs.php.net/?id=49257&edit=1