Edit report at http://bugs.php.net/bug.php?id=52947&edit=1

 ID:                 52947
 Updated by:         fel...@php.net
 Reported by:        blacklight332 at aol dot com
 Summary:            segfault when ssl stream option
                     capture_peer_cert_chain used
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Streams related
 Operating System:   Ubuntu Linux 10.10 beta
 PHP Version:        5.3.3
-Assigned To:        
+Assigned To:        felipe
 Block user comment: N

 New Comment:

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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------
[2010-09-29 03:25:36] fel...@php.net

Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=303839
Log: - Fixed bug #52947 (segfault when ssl stream option
capture_peer_cert_chain used)

------------------------------------------------------------------------
[2010-09-28 22:42:56] blacklight332 at aol dot com

Description:
------------
Bug http://bugs.php.net/bug.php?id=52945 says that the ssl stream
context option capture_peer_chain
(http://www.php.net/manual/en/context.ssl.php) 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://www.digicert.com:443", $errno, $errstr,
30, STREAM_CLIENT_CONNECT, $g);

$cont = stream_context_get_params($r);

var_dump($cont['options']['ssl']);

Expected result:
----------------
array(4) {

  ["capture_peer_cert"]=>

  bool(true)

  ["capture_peer_cert_chain"]=>

  bool(true)

  ["peer_certificate"]=>

  resource(6) of type (OpenSSL X.509)

  ["peer_certificate_chain"]

  -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) {

  ["capture_peer_cert"]=>

  bool(true)

  ["capture_peer_cert_chain"]=>

  bool(true)

  ["peer_certificate"]=>

  resource(6) of type (OpenSSL X.509)

  ["peer_certificate_chain"]

  Segmentation fault (core dumped)




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52947&edit=1

Reply via email to