Skip to content

Commit

Permalink
Extend openssl_x509_parse to cover cert resource
Browse files Browse the repository at this point in the history
  • Loading branch information
bukka committed Oct 30, 2017
1 parent c1d9858 commit cd66aad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/openssl/tests/openssl_x509_parse_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ if (OPENSSL_VERSION_NUMBER < 0x10000000) die("skip Output requires OpenSSL 1.0")
<?php
$cert = "file://" . dirname(__FILE__) . "/cert.crt";

var_dump(openssl_x509_parse($cert));
$parsedCert = openssl_x509_parse($cert);
var_dump($parsedCert === openssl_x509_parse(openssl_x509_read($cert)));
var_dump($parsedCert);
var_dump(openssl_x509_parse($cert, false));
?>
--EXPECTF--
bool(true)
array(16) {
["name"]=>
string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
Expand Down

0 comments on commit cd66aad

Please sign in to comment.