Comments (1)
It's a troubleshooting article, so I still use the format just like "issue----solution";
And due to the article is too simple, I add the content about "Why me meet the error" and "some discription about CA which we use in solution" to rich the article. Please help me to confirm whether it's suitable.
PHP调用认知服务证书认证问题
问题描述
在使用 PHP 的 http 客户端工具(如 Guzzle)调用认知服务时出现证书认证问题,错误信息如下:
Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: unable to get local issuer certificate
解决方法
此问题的出现是由于没有配置信任的服务器 HTTPS 验证。默认, cURL 被设为不信任任何 CAs,因此,这就是无法访问相关服务器的原因。解决该问题的最好方法是指定一组默认的受信任的 CAs。
- CA证书
数字证书认证机构(Certificate Authority, 缩写为 CA),是负责发放和管理数字证书的权威机构,它要制定政策和具体步骤来验证、识别用户身份,并对用户证书进行签名,以确保证书持有者的身份和公钥的拥有权。证书通常包括所有者的公钥、 证书的到期时间、所有者的名称和其他关于所有者的信息。
所以此问题可以通过下载证书的方式进行解决,具体操作方法如下:
- 下载证书保存到本地,下载地址:https://curl.haxx.se/ca/cacert.pem
- 配置 php.ini 文件:
curl.cainfo =<filepath>/cacert.pem
- 重启 Apache 服务器,问题解决。
from acn-content.
Related Issues (20)
- Azure AD 与 Azure 订阅在 Azure **的架构限制与最佳实践 HOT 1
- Azure AD 与 Azure 订阅在 Azure **的架构限制与最佳实践 HOT 1
- 如何将外部文件打包到云服务包中 HOT 1
- 如何将外部文件打包到云服务包中 HOT 1
- 使用 PowerShell 查看经典部署模式下的负载均衡配置 HOT 1
- 百度推送服务绑定关系未找到或不存在 HOT 1
- 如何在 Windows Azure 虚拟机里配置条带化 HOT 1
- 如何激活 Trend Micro Deep Security Agent HOT 1
- https://github.com/JamborYao/acn-content/blob/master/Articles_for_Dec_part_2/aog-virtual-machines-howto-lb-corosync-pacemaker-linux-ha.md HOT 1
- https://github.com/JamborYao/acn-content/blob/master/Articles_for_Dec_part_2/aog-web-apps-configure-local-cache-log-interrupt.md HOT 3
- https://github.com/JamborYao/acn-content/blob/master/Articles_for_Dec_part_2/aog-web-apps-configure-local-cache-log-interrupt.md HOT 3
- https://github.com/JamborYao/acn-content/blob/master/Articles_for_Jan_part_1/aog-sample-code-fa-c%23-fetch-vm-monitor-data.md HOT 1
- https://github.com/JamborYao/acn-content/blob/master/Articles_for_Jan_part_1/aog-cognitive-services-qa-c%23-sdk-key-invalid.md
- https://github.com/JamborYao/acn-content/blob/master/Articles_for_Jan_part_1/aog-iot-hub-eventhubclient-connect-string.md HOT 1
- https://github.com/JamborYao/acn-content/blob/master/Articles_for_Jan_part_1/aog-iot-hub-eventhubclient-connect-string.md HOT 1
- https://github.com/JamborYao/acn-content/blob/master/Articles_for_Jan_part_1/aog-notification-hubs-android-apk-tag-push.md HOT 1
- https://github.com/JamborYao/acn-content/blob/master/Articles_for_Jan_part_1/aog-notification-hubs-direct-consume-message.md HOT 1
- https://github.com/JamborYao/acn-content/blob/master/Articles_for_Jan_part_1/aog-powershell-qa-resource-provider-error.md HOT 1
- Azure媒体直播服务操作流程 HOT 1
- 使Azure虚拟机可Ping的方法
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acn-content.