|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-02 19:20 UTC] jani@php.net
[2009-09-02 19:24 UTC] jerrywilborn at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 22:00:02 2025 UTC |
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