PHP客户端验证https证书
我需要创建一个 php 来充当客户端并使用 https 下的一些 Web 服务。 我的问题是我还想验证服务器证书。我需要知道我有正确的服务器并且中间没有人充当服务器。 有人可以帮我吗?
谢谢!
I need to create a php that will act as a client and use some web services under https.
My Problem is that I also want to verify the server certificate.I need to know that I have the right server and that there is no one the middle that acts as the server.
Can someone help me please?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您有curl 扩展,则可以将其配置为验证连接时的证书。
http://php.net/manual/en/function.curl-setopt。 php
[1] http://www.verisign.com/support/verisign-intermediate-ca/extended-validation/apache/
If you have the curl extension, it can be configured to verify a certificate on connection.
http://php.net/manual/en/function.curl-setopt.php
[1] http://www.verisign.com/support/verisign-intermediate-ca/extended-validation/apache/
看起来从 Curl 7.10 开始,现在默认都设置为检查:
http://php.net/manual/en/function.curl-setopt。 php
It looks like as of Curl 7.10, this is all set to be checked by default now:
http://php.net/manual/en/function.curl-setopt.php