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/peer_verification.phpt ('Peer verification enabled for client streams')

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:     for ($i = 0; $i < 5; $i++) {
13:         @stream_socket_accept($server, 1);
14:     }
15:
CODE;
16:
17:
$clientCode = <<<'CODE'
18:
    $serverUri = "ssl://127.0.0.1:64321";
19:     $clientFlags = STREAM_CLIENT_CONNECT;
20:     $caFile = __DIR__ . '/bug54992-ca.pem';
21:
22:     phpt_wait();
23:
24:     // Expected to fail -- untrusted server cert and no CA File present
25:     var_dump(@stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags));
26:
27:     // Expected to fail -- untrusted server cert and no CA File present
28:     $clientCtx = stream_context_create(['ssl' => [
29:         'verify_peer' => true,
30:     ]]);
31:     var_dump(@stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
32:
33:     // Should succeed with peer verification disabled in context
34:     $clientCtx = stream_context_create(['ssl' => [
35:         'verify_peer' => false,
36:         'verify_peer_name' => false,
37:     ]]);
38:     var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
39:
40:     // Should succeed with CA file specified in context
41:     $clientCtx = stream_context_create(['ssl' => [
42:         'cafile'   => $caFile,
43:         'peer_name' => 'bug54992.local',
44:     ]]);
45:     var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
46:
CODE;
47:
48: include 
'ServerClientTestCase.inc';
49:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
50:

Expected

bool(false)
bool(false)
resource(%d) of type (stream)
resource(%d) of type (stream)

Output

bool(false)
bool(false)

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 21

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 21

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 21
bool(false)

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 28

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 28

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 28
bool(false)

Diff

003+ 
004+ 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 21
003- resource(%d) of type (stream)
004- resource(%d) of type (stream)
005+ 
006+ 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 21
007+ 
008+ 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 21
009+ bool(false)
010+ 
011+ 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 28
012+ 
013+ 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 28
014+ 
015+ 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 28
016+ bool(false)

 

Generated at Mon, 04 Aug 2014 15:49:20 +0000 (27 days ago)

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