|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52947 segfault when ssl stream option capture_peer_cert_chain used
Submitted: 2010-09-28 22:42 UTC Modified: 2010-09-29 03:26 UTC
From: blacklight332 at aol dot com Assigned: felipe (profile)
Status: Closed Package: Streams related
PHP Version: 5.3.3 OS: Ubuntu Linux 10.10 beta
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: blacklight332 at aol dot com
New email:
PHP Version: OS:


 [2010-09-28 22:42 UTC] blacklight332 at aol dot com
Bug says that the ssl stream context option capture_peer_chain ( was really implemented as capture_peer_cert_chain in the php project source code.

Once this fact is realized, then I tried to use the option capture_peer_cert_chain in an ssl stream context connection, and it segfaults when I do a var_dump.

Test script:
$o = array("capture_peer_cert" => true,"capture_peer_cert_chain" => true,);
$g = stream_context_create (array("ssl" => $o));
$r = stream_socket_client("ssl://", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $g);
$cont = stream_context_get_params($r);

Expected result:
array(4) {
  resource(6) of type (OpenSSL X.509)
  -something other than a segfault-

I hope the "peer_certificate_chain" would be an array of "resource(6) of type (OpenSSL X.509)" but I'm not sure if that is the intended behavior or not.

Actual result:
array(4) {
  resource(6) of type (OpenSSL X.509)
  Segmentation fault (core dumped)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-29 03:25 UTC]
Automatic comment from SVN on behalf of felipe
Log: - Fixed bug #52947 (segfault when ssl stream option capture_peer_cert_chain used)
 [2010-09-29 03:26 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-09-29 03:26 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Aug 16 07:05:45 2022 UTC