|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2006-12-31 21:00 UTC] iliaa@php.net
  [2007-01-08 01:00 UTC] php-bugs at lists dot php dot net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 15:00:01 2025 UTC | 
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, } }