我有一个奇怪的问题。将我的 LAMP 开发机器 (Debian) 更新为 PHP 7。之后我无法再通过 Curl 连接到特定的 TLS 加密 API。
有问题的 SSL 证书由 thawte 签名。
curl https://example.com
Run Code Online (Sandbox Code Playgroud)
给我
curl: (60) SSL certificate problem: unable to get local issuer certificate
Run Code Online (Sandbox Code Playgroud)
然而
curl https://thawte.com
Run Code Online (Sandbox Code Playgroud)
当然,这也是 Thawte 作品的签名。
我可以在其他机器上通过 HTTPS 访问 API 站点,例如我的桌面通过 curl 和浏览器。所以证书绝对有效。SSL 实验室评级为 A。
从我的开发机器到其他 SSL 加密站点的任何其他 Curl 请求都有效。我的根证书是最新的。为了验证,我跑了update-ca-certificates
。我什至将http://curl.haxx.se/ca/cacert.pem下载到 /etc/ssl/certs 并运行c_rehash
.
还是一样的错误。
有什么方法可以调试验证过程并查看哪个本地颁发者证书 curl(或 openssl)正在寻找但未找到,即文件名?
更新
curl -vs https://example.com
Run Code Online (Sandbox Code Playgroud)
告诉我(IP+域名匿名)
* Hostname was NOT found in DNS cache
* Trying 192.0.2.1...
* …
Run Code Online (Sandbox Code Playgroud)