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/stream_crypto_flags_003.phpt ('Server bitwise stream crypto flag assignment')

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:         // Only accept SSLv3 and TLSv1.2 connections
9:         'crypto_method' => STREAM_CRYPTO_METHOD_SSLv3_SERVER  | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER,
10:     ]]);
11:
12:     $server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
13:     phpt_notify();
14:
15:     @stream_socket_accept($server, 1);
16:     @stream_socket_accept($server, 1);
17:     @stream_socket_accept($server, 1);
18:     @stream_socket_accept($server, 1);
19:
CODE;
20:
21:
$clientCode = <<<'CODE'
22:
    $serverUri = "ssl://127.0.0.1:64321";
23:     $clientFlags = STREAM_CLIENT_CONNECT;
24:     $clientCtx = stream_context_create(['ssl' => [
25:         'verify_peer' => true,
26:         'cafile' => __DIR__ . '/bug54992-ca.pem',
27:         'peer_name' => 'bug54992.local',
28:     ]]);
29:
30:     phpt_wait();
31:
32:     stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
33:     var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
34:
35:     stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_SSLv3_CLIENT);
36:     var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
37:
38:     stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT);
39:     var_dump(@stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
40:
41:     stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT);
42:     var_dump(@stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
43:
CODE;
44:
45: include 
'ServerClientTestCase.inc';
46:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
47:

Expected

resource(%d) of type (stream)
resource(%d) of type (stream)
bool(false)
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 12

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 12

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 12
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 15

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 15

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 15
bool(false)
bool(false)
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 12
002+ 
003+ 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 12
004+ 
005+ 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 12
006+ bool(false)
007+ 
008+ 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 15
009+ 
010+ 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 15
011+ 
012+ 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 15
013+ bool(false)
001- resource(%d) of type (stream)
002- resource(%d) of type (stream)

 

Generated at Wed, 22 Oct 2014 07:25:05 +0000 (2 days ago)

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