私は証明書を持っており、ファイルパスからSHA 1 Fingerprint
とSHA 256 Fingerprint
を読みたいと思います。PHPのパスから証明書のサムプリントを読み取る方法
<?php
ini_set("display_startup_errors", 1);
ini_set("display_errors", 1);
error_reporting(-1);
$certificate = "./wwwbbminfocom.crt";
$cert = openssl_x509_read($certificate);
$sha1_hash = openssl_x509_fingerprint($cert); // sha1 hash
$md5_hash = openssl_x509_fingerprint($cert, 'md5'); // md5 hash
?>
注:
Warning: openssl_x509_read(): supplied parameter cannot be coerced into an X509 certificate! in /home/super/public_html/md.php on line 8
Warning: openssl_x509_fingerprint(): cannot get cert from parameter 1 in /home/super/public_html/md.php on line 9
Warning: openssl_x509_fingerprint(): cannot get cert from parameter 1 in /home/super/public_html/md.php on line 10
親切にファイルを読み込み、指紋を取得する方法を私を助ける:私は、次のPHPの警告を得たウェブサイトからhttps://www.bbminfo.com/Tutor/php_error_error_log.php
をSSL証明書をダウンロードしました。私は使用していますPHP 7.0
てみてください: '$ CERT = openssl_x509_read(のfile_get_contents($証明書));' –
@MagnusErikssonを - どうもありがとう...そのワーキング... –