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/san_peer_matching.phpt ('Peer verification matches SAN names')

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__ . '/san-cert.pem',
7:     ]]);
8:
9:     $server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
10:     phpt_notify();
11:
12:     @stream_socket_accept($server, 1);
13:     @stream_socket_accept($server, 1);
14:
CODE;
15:
16:
$clientCode = <<<'CODE'
17:
    $serverUri = "ssl://127.0.0.1:64321";
18:     $clientFlags = STREAM_CLIENT_CONNECT;
19:     $clientCtx = stream_context_create(['ssl' => [
20:         'verify_peer' => false,
21:         'cafile' => __DIR__ . '/san-ca.pem',
22:     ]]);
23:
24:     phpt_wait();
25:
26:     stream_context_set_option($clientCtx, 'ssl', 'peer_name', 'example.org');
27:     var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
28:
29:     stream_context_set_option($clientCtx, 'ssl', 'peer_name', 'moar.example.org');
30:     var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
31:
CODE;
32:
33: include 
'ServerClientTestCase.inc';
34:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
35:

Expected

resource(%d) of type (stream)

Warning: stream_socket_client(): Unable to locate peer certificate CN 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_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 11

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

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

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

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

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

Diff

001+ Warning: stream_socket_client(): SSL: Handshake timed out in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 11
001- resource(%d) of type (stream)
003+ Warning: stream_socket_client(): Failed to enable crypto in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 11
004+ 
005+ Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 (Unknown error) in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 11
006+ bool(false)
007+ 
008+ Warning: stream_socket_client(): SSL: Handshake timed out in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 14
003- Warning: stream_socket_client(): Unable to locate peer certificate CN in %s on line %d

 

Generated at Sat, 19 Jul 2014 23:25:50 +0000 (12 days ago)

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