gpt4 book ai didi

ssl - cURL 说证书已过期,Firefox 不同意

转载 作者:太空宇宙 更新时间:2023-11-03 12:49:18 25 4
gpt4 key购买 nike

我正在尝试通过 cURL 访问一个内部站点(我几天前就可以访问)。但是,cURL 给出错误 curl: (60) SSL certificate problem: certificate has expired。如果我使用 openssl 检查证书的开始和结束日期,它会给出一个我完全在其中的时间范围:

echo | openssl s_client -connect internalsite.example.com:443 2>/dev/null | openssl x509 -noout -dates
notBefore=Nov 30 00:00:00 2012 GMT
notAfter=Mar 30 12:00:00 2016 GMT
# For reference, the day I'm posting this is July 30th, 2014

此外,如果我在另一台计算机上使用 cURL,或通过浏览器(Firefox、Chrome 或 IE)连接,我可以正确连接。

此外,我无法在自己的计算机上连接任何版本的 cURL;这包括虚拟机中 Cygwin 中的 cURL 和 Ubuntu 中的 cURL,以及 Windows 版本。

什么可能会导致这种行为?

最佳答案

您的证书包可能已过期。

您可以在 http://curl.haxx.se/ca/cacert.pem 获得由 curl 开发人员维护的一个

使用方法:

<?
$ch = curl_init("http://example.com");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, '/path/to/cacert.pem');
$response = curl_exec($ch);

关于ssl - cURL 说证书已过期,Firefox 不同意,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25047732/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com