PHP  
 PHP_7_1
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/openssl/tests/bug48182.phpt ('Bug #48182: ssl handshake fails during asynchronous socket connection')

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:     $client = @stream_socket_accept($server, 1);
13:
14:     $data = "Sending bug48182\n" . fread($client, 8192);
15:     fwrite($client, $data);
16:
CODE;
17:
18:
$clientCode = <<<'CODE'
19:
    $serverUri = "ssl://127.0.0.1:64321";
20:     $clientFlags = STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT;
21:     $clientCtx = stream_context_create(['ssl' => [
22:         'cafile' => __DIR__ . '/bug54992-ca.pem',
23:         'peer_name' => 'bug54992.local'
24:     ]]);
25:
26:     phpt_wait();
27:     $client = stream_socket_client($serverUri, $errno, $errstr, 10, $clientFlags, $clientCtx);
28:
29:     $data = "Sending data over to SSL server in async mode with contents like Hello World\n";
30:
31:     fwrite($client, $data);
32:     echo fread($client, 1024);
33:
CODE;
34:
35: echo 
"Running bug48182\n";
36:
37: include 
'ServerClientTestCase.inc';
38:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
39:
?>
40:

Expected

Running bug48182
Sending bug48182
Sending data over to SSL server in async mode with contents like Hello World

Output

Running bug48182

Warning: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /var/php_gcov/PHP_7_1/ext/openssl/tests/ServerClientTestCase.inc(96) : eval()'d code on line 9

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

Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 (Unknown error) in /var/php_gcov/PHP_7_1/ext/openssl/tests/ServerClientTestCase.inc(96) : eval()'d code on line 9

Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_7_1/ext/openssl/tests/ServerClientTestCase.inc(96) : eval()'d code on line 13

Warning: fread() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_7_1/ext/openssl/tests/ServerClientTestCase.inc(96) : eval()'d code on line 14

Diff

002+ 
003+ Warning: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
002- Sending bug48182
003- Sending data over to SSL server in async mode with contents like Hello World
004+ error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /var/php_gcov/PHP_7_1/ext/openssl/tests/ServerClientTestCase.inc(96) : eval()'d code on line 9
005+ 
006+ Warning: stream_socket_client(): Failed to enable crypto in /var/php_gcov/PHP_7_1/ext/openssl/tests/ServerClientTestCase.inc(96) : eval()'d code on line 9
007+ 
008+ Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 (Unknown error) in /var/php_gcov/PHP_7_1/ext/openssl/tests/ServerClientTestCase.inc(96) : eval()'d code on line 9
009+ 
010+ Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_7_1/ext/openssl/tests/ServerClientTestCase.inc(96) : eval()'d code on line 13
011+ 
012+ Warning: fread() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_7_1/ext/openssl/tests/ServerClientTestCase.inc(96) : eval()'d code on line 14

 

Generated at Wed, 01 Dec 2021 02:17:55 +0000 (3 days ago)

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