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: $certFile 
__DIR__ DIRECTORY_SEPARATOR 'stream_crypto_flags_003.pem.tmp';
3:
$cacertFile __DIR__ DIRECTORY_SEPARATOR 'stream_crypto_flags_003-ca.pem.tmp';
4:
5:
$serverCode = <<<'CODE'
6:
    $serverUri = "ssl://127.0.0.1:64321";
7:     $serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
8:     $serverCtx = stream_context_create(['ssl' => [
9:         'local_cert' => '%s',
10:
11:         // Only accept TLSv1.2 connections
12:         'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_0_SERVER  | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER,
13:     ]]);
14:
15:     $server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
16:     phpt_notify();
17:
18:     @stream_socket_accept($server, 1);
19:     @stream_socket_accept($server, 1);
20:     @stream_socket_accept($server, 1);
21:     @stream_socket_accept($server, 1);
22:
CODE;
23:
$serverCode sprintf($serverCode$certFile);
24:
25:
$peerName 'stream_crypto_flags_003';
26:
$clientCode = <<<'CODE'
27:
    $serverUri = "ssl://127.0.0.1:64321";
28:     $clientFlags = STREAM_CLIENT_CONNECT;
29:     $clientCtx = stream_context_create(['ssl' => [
30:         'verify_peer' => true,
31:         'cafile' => '%s',
32:         'peer_name' => '%s',
33:     ]]);
34:
35:     phpt_wait();
36:
37:     stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
38:     var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
39:
40:     stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT);
41:     var_dump(@stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
42:
43:     stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT);
44:     var_dump(@stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
45:
CODE;
46:
$clientCode sprintf($clientCode$cacertFile$peerName);
47:
48: include 
'CertificateGenerator.inc';
49:
$certificateGenerator = new CertificateGenerator();
50:
$certificateGenerator->saveCaCert($cacertFile);
51:
$certificateGenerator->saveNewCertAsFileWithKey($peerName$certFile);
52:
53: include 
'ServerClientTestCase.inc';
54:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
55:
?>
56:

Expected

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

Output

Warning: stream_socket_client(): SSL: Handshake timed out in /var/php_gcov/PHP_HEAD/ext/openssl/tests/ServerClientTestCase.inc(130) : 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(130) : 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(130) : eval()'d code on line 12
bool(false)
bool(false)
resource(20) of type (stream)

Diff

001+ Warning: stream_socket_client(): SSL: Handshake timed out in /var/php_gcov/PHP_HEAD/ext/openssl/tests/ServerClientTestCase.inc(130) : 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(130) : 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(130) : eval()'d code on line 12
006+ bool(false)
007+ bool(false)
002- resource(%d) of type (stream)
003- resource(%d) of type (stream)

 

Generated at Mon, 06 May 2019 17:58:35 +0000 (41 days ago)

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