PHP  
 PHP_5_6
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/openssl/tests/capture_peer_cert_001.phpt ('capture_peer_cert context captures on verify failure')

Script

1: <?php
2: $serverCode 
= <<<'CODE'
3:
    $serverUri = "ssl://127.0.0.1:64321";
4:     $serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
5:     $serverCtx = stream_context_create(['ssl' => [
6:         'local_cert' => __DIR__ . '/bug54992.pem'
7:     ]]);
8:
9:     $server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
10:     phpt_notify();
11:
12:     @stream_socket_accept($server, 1);
13:
CODE;
14:
15:
$clientCode = <<<'CODE'
16:
    $serverUri = "ssl://127.0.0.1:64321";
17:     $clientFlags = STREAM_CLIENT_CONNECT;
18:     $clientCtx = stream_context_create(['ssl' => [
19:         'capture_peer_cert' => true,
20:         'cafile' => __DIR__ . '/bug54992-ca.pem'
21:     ]]);
22:
23:     phpt_wait();
24:     $client = @stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx);
25:     $cert = stream_context_get_options($clientCtx)['ssl']['peer_certificate'];
26:     var_dump(openssl_x509_parse($cert)['subject']['CN']);
27:
CODE;
28:
29: include 
'ServerClientTestCase.inc';
30:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
31:

Expected

string(%d) "bug54992.local"

Output

Notice: Undefined index: peer_certificate in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 10
NULL

Diff

001+ Notice: Undefined index: peer_certificate in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 10
001- string(%d) "bug54992.local"
002+ NULL

 

Generated at Wed, 10 Dec 2014 19:30:08 +0000 (9 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.