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