PHP  
 PHP_5_3
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: $context 
stream_context_create();
3:
4:
stream_context_set_option($context'ssl''local_cert'__DIR__ "/bug54992.pem");
5:
stream_context_set_option($context'ssl''allow_self_signed'true);
6:
$server stream_socket_server('ssl://127.0.0.1:64321'$errno$errstr,
7:     
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN$context);
8:
9:
10:
$pid pcntl_fork();
11: if (
$pid == -1) {
12:     die(
'could not fork');
13: } else if (
$pid) {
14:     
$contextC stream_context_create(
15:         array(
16:             
'ssl' => array(
17:                 
'verify_peer'        => true,
18:                 
'cafile'        => __DIR__ '/bug54992-ca.pem',
19:                 
'CN_match'        => 'buga_buga',
20:             )
21:         )
22:     );
23:     
var_dump(stream_socket_client("ssl://127.0.0.1:64321"$errno$errstr1,
24:         
STREAM_CLIENT_CONNECT$contextC));
25: } else {    
26:     @
pcntl_wait($status);
27:     @
stream_socket_accept($server1);
28: }
29:

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: crypto enabling timeout in /var/php_gcov/PHP_5_3/ext/openssl/tests/bug54992.php on line 24

Warning: stream_socket_client(): Failed to enable crypto in /var/php_gcov/PHP_5_3/ext/openssl/tests/bug54992.php on line 24

Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 (Unknown error) in /var/php_gcov/PHP_5_3/ext/openssl/tests/bug54992.php on line 24
bool(false)

Diff

001+ Warning: stream_socket_client(): SSL: crypto enabling timeout in /var/php_gcov/PHP_5_3/ext/openssl/tests/bug54992.php on line 24
001- Warning: stream_socket_client(): Peer certificate CN=`bug54992.local' did not match expected CN=`buga_buga' in %s on line %d

 

Generated at Sun, 27 Jul 2014 12:58:43 +0000 (3 days ago)

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