How to view SSL certificate information in PHP

Source: Internet
Author: User
Tags ssl certificate
This article gives you a description of how to use PHP to view the SSL certificate information, the text and examples to introduce to you, there is a need for friends to reference, the following to see together.

Objective

SSL certificates are compliant with the SSL protocol, issued by a trusted digital certification authority CA, after authenticating the server, with server authentication and data transfer encryption. The following is an example of how to view SSL certificate information through PHP, which you need to see.

Sample code

< $str = file_get_contents (' 2.cer ');p rint_r (Openssl_x509_parse ($STR));? >

Note: Certificates require a CER certificate that uses Base64 encoding.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.