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

Test Failure Report for ext/openssl/tests/sni_server.phpt ('sni_server')

Script

1: <?php
2: $serverCode 
= <<<'CODE'
3:
    $flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN;
4:     $ctx = stream_context_create(['ssl' => [
5:         'local_cert' => __DIR__ . '/domain1.pem',
6:         'SNI_server_certs' => [
7:             "domain1.com" => __DIR__ . "/sni_server_domain1.pem",
8:             "domain2.com" => __DIR__ . "/sni_server_domain2.pem",
9:             "domain3.com" => __DIR__ . "/sni_server_domain3.pem"
10:         ]
11:     ]]);
12:
13:     $server = stream_socket_server('tls://127.0.0.1:64321', $errno, $errstr, $flags, $ctx);
14:     phpt_notify();
15:
16:     for ($i=0; $i < 3; $i++) {
17:         @stream_socket_accept($server, 3);
18:     }
19:
CODE;
20:
21:
$clientCode = <<<'CODE'
22:
    $flags = STREAM_CLIENT_CONNECT;
23:     $ctxArr = [
24:         'cafile' => __DIR__ . '/sni_server_ca.pem',
25:         'capture_peer_cert' => true
26:     ];
27:
28:     phpt_wait();
29:
30:     $ctxArr['peer_name'] = 'domain1.com';
31:     $ctx = stream_context_create(['ssl' => $ctxArr]);
32:     $client = stream_socket_client("tls://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx);
33:     $cert = stream_context_get_options($ctx)['ssl']['peer_certificate'];
34:     var_dump(openssl_x509_parse($cert)['subject']['CN']);
35:
36:     $ctxArr['peer_name'] = 'domain2.com';
37:     $ctx = stream_context_create(['ssl' => $ctxArr]);
38:     $client = @stream_socket_client("tls://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx);
39:     $cert = stream_context_get_options($ctx)['ssl']['peer_certificate'];
40:     var_dump(openssl_x509_parse($cert)['subject']['CN']);
41:
42:     $ctxArr['peer_name'] = 'domain3.com';
43:     $ctx = stream_context_create(['ssl' => $ctxArr]);
44:     $client = @stream_socket_client("tls://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx);
45:     $cert = stream_context_get_options($ctx)['ssl']['peer_certificate'];
46:     var_dump(openssl_x509_parse($cert)['subject']['CN']);
47:
CODE;
48:
49: include 
'ServerClientTestCase.inc';
50:
ServerClientTestCase::getInstance()->run($clientCode$serverCode);
51:

Expected

string(%d) "domain1.com"
string(%d) "domain2.com"
string(%d) "domain3.com"

Output

Warning: stream_socket_client(): SSL: Handshake timed out in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 11

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

Warning: stream_socket_client(): unable to connect to tls://127.0.0.1:64321 (Unknown error) in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 11

Notice: Undefined index: peer_certificate in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 12
NULL

Notice: Undefined index: peer_certificate in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 18
NULL

Notice: Undefined index: peer_certificate in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 24
NULL

Diff

001+ Warning: stream_socket_client(): SSL: Handshake timed out in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 11
002+ 
003+ Warning: stream_socket_client(): Failed to enable crypto in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 11
001- string(%d) "domain1.com"
002- string(%d) "domain2.com"
003- string(%d) "domain3.com"
004+ 
005+ Warning: stream_socket_client(): unable to connect to tls://127.0.0.1:64321 (Unknown error) in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 11
006+ 
007+ Notice: Undefined index: peer_certificate in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 12
008+ NULL
009+ 
010+ Notice: Undefined index: peer_certificate in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 18
011+ NULL
012+ 
013+ Notice: Undefined index: peer_certificate in /var/php_gcov/PHP_5_6/ext/openssl/tests/ServerClientTestCase.inc(92) : eval()'d code on line 24
014+ NULL

 

Generated at Mon, 08 Sep 2014 17:35:45 +0000 (7 days ago)

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