[php-src] Issue #11918: OpenSSL X509 Version
| From: | jyxjjj | Date: | Wed, 09 Aug 2023 02:32:19 +0000 |
| Subject: | [php-src] Issue #11918: OpenSSL X509 Version | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245135@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11918
Author: jyxjjj
### Description
The following code:
```php
$pub =
openssl_x509_parse(file_get_contents('app/Common/Certificates/fullchain.pem'));
```
Resulted in this output:
```
"version" => 2
```
But I expected this output instead:
```
"version" => 3
```
Does this used the 16 based number?
Because openssl command line said 3 == 0x2.
I mean if i want to detect version 1 i should use
if($version==0)
### PHP Version
PHP 8.2.8 (cli) (built: Jul 13 2023 08:19:56) (NTS)
### Operating System
_No response_