xref: /PHP-8.0/ext/openssl/tests/bug64802.phpt (revision ded3d984)
1--TEST--
2Bug #64802: openssl_x509_parse fails to parse subject properly in some cases
3--SKIPIF--
4<?php
5if (!extension_loaded("openssl")) die("skip");
6if (!defined('OPENSSL_KEYTYPE_EC')) die("skip no EC available");
7?>
8--FILE--
9<?php
10$cert = file_get_contents(__DIR__.'/bug64802.pem');
11$r = openssl_x509_parse($cert,$use_short_names=false);
12var_dump($r['subject']['commonName']);
13?>
14--EXPECT--
15array(6) {
16  [0]=>
17  string(9) "www.rd.io"
18  [1]=>
19  string(8) "rdio.com"
20  [2]=>
21  string(5) "rd.io"
22  [3]=>
23  string(12) "api.rdio.com"
24  [4]=>
25  string(9) "api.rd.io"
26  [5]=>
27  string(12) "www.rdio.com"
28}
29