How to view SSL certificate information in php

怪我咯
Release: 2023-03-12 16:52:01
Original
1304 people have browsed it

This article introduces how to use PHP to view SSL certificate information. The article introduces it to you through pictures, texts and examples. Friends can refer to it if necessary. Let's take a look together.

Preface

SSL certificate complies with the SSL protocol and is issued by a trusted digital certificate authority CA after verifying the server's identity. It has server identity verification and data transmission. Encryption function. The following is an example of viewing SSL certificate information through PHP. You can take a look if you need it.

Sample code

<?
$str = file_get_contents(&#39;2.cer&#39;);
print_r(openssl_x509_parse($str));
?>
Copy after login

Note: The certificate needs to use the base64 encoded cer certificate.

The above is the detailed content of How to view SSL certificate information in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!