本文介绍了PHP SSL证书指纹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在SSL证书的网页指纹中显示.有可能在PHP中吗?函数

I need display in web page fingerprints of SSL Certificate.Is it possible in PHP? The function

openssl_x509_parse

不返回SHA1和MD5指纹.如何解决这个问题?谢谢.

doesn't return SHA1 and MD5 fingerprints.How resolve this problem?Thanks.

推荐答案

我猜最简单的方法是通过系统调用openssl

I'd guess the easiest way is going to be to call openssl through system

$fingerprint = str_replace("SHA1 Fingerprint=", '', system('openssl x509 -noout -in /path/to/your/cert.pem -fingerprint'));

是的,我知道,这完全不是一种干净的方法-但是,这是我唯一想到的我的脑袋!

And yes, I know, this is nothing like a clean way of doing this - however, it's the only one I can think of of the top of my head!!!

这篇关于PHP SSL证书指纹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 05:44