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

Test Failure Report for ext/openssl/tests/bug54992.phpt ('Bug #54992: Stream not closed and error not returned when SSL CN_match fails')

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:         'verify_peer' => true,
20:         'cafile' => __DIR__ . '/bug54992-ca.pem',
21:         'peer_name' => 'buga_buga',
22:     ]]);
23:
24:     phpt_wait();
25:     $client = stream_socket_client($serverUri, $errno, $errstr, 2, $clientFlags, $clientCtx);
26:
27:     var_dump($client);
28:
CODE;
29:
30: include 
'ServerClientTestCase.inc';
31:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
32:

Expected

Warning: stream_socket_client(): Peer certificate CN=`bug54992.local' did not match expected CN=`buga_buga' in %s on line %d

Warning: stream_socket_client(): Failed to enable crypto in %s on line %d

Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 (Unknown error) in %s on line %d
bool(false)

Output

Warning: stream_socket_client(): SSL: Handshake timed out in /var/php_gcov/PHP_HEAD/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 10

Warning: stream_socket_client(): Failed to enable crypto in /var/php_gcov/PHP_HEAD/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 10

Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 (Unknown error) in /var/php_gcov/PHP_HEAD/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 10
bool(false)

Diff

001+ Warning: stream_socket_client(): SSL: Handshake timed out in /var/php_gcov/PHP_HEAD/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 10
001- Warning: stream_socket_client(): Peer certificate CN=`bug54992.local' did not match expected CN=`buga_buga' in %s on line %d

 

Generated at Tue, 14 Oct 2014 07:25:56 +0000 (7 days ago)

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