php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38384 Asynchronous Connections
Submitted: 2006-08-08 16:25 UTC Modified: 2007-01-08 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ctm at etheon dot net Assigned:
Status: No Feedback Package: Streams related
PHP Version: 5.1.4 OS: Windows NT
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-08-08 16:25 UTC] ctm at etheon dot net
Description:
------------
I'm not entirely sure if this is a bug or not, but when using the capture_peer_cert SSL context with a normal socket based stream connection (as opposed to it being asynchronous), I obtain the peer_certificate easily in the stream's context options.

When using it an asynchronous connection though, even after using stream select and the likes, I can't seem to capture the peer's certificate, even though I have the same context as used in the "normal" connections.

Reproduce code:
---------------
$ctx = stream_context_create ( array ( 'ssl' => array ( 'verify_peer'	    => false, 'capture_peer_cert' => true ) ) ) ; 

    $socket = stream_socket_client ( $host, $errno, $errstr, $timeout, STREAM_CLIENT_ASYNC_CONNECT|STREAM_CLIENT_CONNECT, $ctx ) ;

$info = stream_context_get_options ( $socket ) ;

print_r ( $info ) ;

Expected result:
----------------
Array
{
   [ssl] => Array
            {
               verify_peer => ,
               capture_peer_cert => 1,
               peer_certificate => Resource id #6
            }
}

Actual result:
--------------
Array
{
   [ssl] => Array
            {
               verify_peer => ,
               capture_peer_cert => 1,
            }
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-31 21:00 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2007-01-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC