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/stream_crypto_flags_004.phpt ('Specific protocol method specification')

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:         'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_0_SERVER,
8:     ]]);
9:
10:     $server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
11:     phpt_notify();
12:
13:     @stream_socket_accept($server, 1);
14:     @stream_socket_accept($server, 1);
15:     @stream_socket_accept($server, 1);
16:     @stream_socket_accept($server, 1);
17:
CODE;
18:
19:
$clientCode = <<<'CODE'
20:
    $serverUri = "ssl://127.0.0.1:64321";
21:     $clientFlags = STREAM_CLIENT_CONNECT;
22:     $clientCtx = stream_context_create(['ssl' => [
23:         'verify_peer' => true,
24:         'cafile' => __DIR__ . '/bug54992-ca.pem',
25:         'peer_name' => 'bug54992.local',
26:     ]]);
27:
28:     phpt_wait();
29:
30:     // Should succeed because the SSLv23 handshake here is compatible with the
31:     // TLSv1 hello method employed in the server
32:     var_dump(@stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
33:
34:     // Should fail because the TLSv1.1 hello method is not supported
35:     stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT);
36:     var_dump(@stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
37:
38:     // Should fail because the TLSv1.2 hello method is not supported
39:     stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
40:     var_dump(@stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
41:
42:     // Should succeed because we use the same TLSv1 hello
43:     stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT);
44:     var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
45:
CODE;
46:
47: include 
'ServerClientTestCase.inc';
48:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
49:

Expected

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

Output

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

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 25

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

Diff

001+ bool(false)
001- resource(%d) of type (stream)
004+ 
004- resource(%d) of type (stream)
005+ 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 25
006+ 
007+ 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 25
008+ 
009+ 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 25
010+ bool(false)

 

Generated at Mon, 20 Oct 2014 09:57:58 +0000 (32 hours ago)

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