使用 PHP 找出所有 SSL 链到 root

发布于 2025-01-19 04:12:29 字数 320 浏览 3 评论 0原文

我正在寻找一种从域名到root的所有SSL链的方法。

我将openssl_x509_parse与stream_context_create一起使用。我得到了证书,发行人等。从那里,我正在遇到一个艰难的地方,找到了中间的词根。

print_r输出的一部分是[pertionalfoaccess]。我认为我应该在那里找到它,因此我解析了这条线(包含CA发行人的一条,而不是OCSP的发行人),并以相同的方式处理。有时我会看到根名,有时它可以直接链接到Cacert,我不知道该如何解析。

有没有一种方法可以每次使用OpenSL_X509_PARSE恢复中间和根?

谢谢 :)

I'm looking for a way to find all SSL chain from domain name to root.

I use openssl_x509_parse with stream_context_create. I got the certificate, issuer etc. From there I'm having a hardway finding the intermediate if any and root issuer.

Part of the print_r output is [authorityInfoAccess]. I figured I should find it there, so I parsed this line (the one containing CA Issuers not the one with OCSP) and processed it the same way. Sometimes I can see the root name, sometimes it gives me a direct link to cacert which I don't know how to parse.

Is there a way to recover intermediate and root everytime with openssl_x509_parse ?

Thank you :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文