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_002.phpt ('Allow host name mismatch when "verify_host" disabled')

Script

1: <?php
2: $certFile 
__DIR__ DIRECTORY_SEPARATOR 'stream_verify_peer_name_002.pem.tmp';
3:
$cacertFile __DIR__ DIRECTORY_SEPARATOR 'stream_verify_peer_name_002-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:
12:     $server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
13:     phpt_notify();
14:
15:     @stream_socket_accept($server, 1);
16:
CODE;
17:
$serverCode sprintf($serverCode$certFile);
18:
19:
$actualPeerName 'stream_verify_peer_name_002';
20:
$clientCode = <<<'CODE'
21:
    $serverUri = "ssl://127.0.0.1:64321";
22:     $clientFlags = STREAM_CLIENT_CONNECT;
23:     $clientCtx = stream_context_create(['ssl' => [
24:         'verify_peer' => true,
25:         'cafile' => '%s',
26:         'verify_peer_name' => false
27:     ]]);
28:
29:     phpt_wait();
30:     $client = stream_socket_client($serverUri, $errno, $errstr, 2, $clientFlags, $clientCtx);
31:
32:     var_dump($client);
33:
CODE;
34:
$clientCode sprintf($clientCode$cacertFile);
35:
36: include 
'CertificateGenerator.inc';
37:
$certificateGenerator = new CertificateGenerator();
38:
$certificateGenerator->saveCaCert($cacertFile);
39:
$certificateGenerator->saveNewCertAsFileWithKey($actualPeerName$certFile);
40:
41: include 
'ServerClientTestCase.inc';
42:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
43:
?>
44:

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

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 10

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

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 10
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(130) : eval()'d code on line 10
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 10
006+ bool(false)

 

Generated at Tue, 19 Mar 2019 00:18:08 +0000 (4 days ago)

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