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_verify_peer_name_001.phpt ('Verify host name by default in client transfers')

Script

1: <?php
2: $certFile 
__DIR__ DIRECTORY_SEPARATOR 'stream_verify_peer_name_001.pem.tmp';
3:
4:
$serverCode = <<<'CODE'
5:
    $serverUri = "ssl://127.0.0.1:64321";
6:     $serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
7:     $serverCtx = stream_context_create(['ssl' => [
8:         'local_cert' => '%s'
9:     ]]);
10:
11:     $server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
12:     phpt_notify();
13:
14:     @stream_socket_accept($server, 1);
15:
CODE;
16:
$serverCode sprintf($serverCode$certFile);
17:
18:
$peerName 'stream_verify_peer_name_001';
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' => false,
24:         'peer_name' => '%s'
25:     ]]);
26:
27:     phpt_wait();
28:     $client = stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx);
29:
30:     var_dump($client);
31:
CODE;
32:
$clientCode sprintf($clientCode$peerName);
33:
34: include 
'CertificateGenerator.inc';
35:
$certificateGenerator = new CertificateGenerator();
36:
$certificateGenerator->saveNewCertAsFileWithKey($peerName$certFile);
37:
38: include 
'ServerClientTestCase.inc';
39:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
40:
?>
41:

Expected

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(96) : eval()'d code on line 9

Warning: stream_socket_client(): Failed to enable crypto in /var/php_gcov/PHP_HEAD/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_HEAD/ext/openssl/tests/ServerClientTestCase.inc(96) : eval()'d code on line 9
bool(false)

Diff

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

 

Generated at Mon, 14 Jan 2019 03:56:25 +0000 (8 days ago)

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