1
經過網絡衝浪後,我真的在智慧結束。我知道這個問題已被多次提出,但沒有任何解決方案能解決我的問題。我想知道是否有任何其他已知的捲曲錯誤60的原因:「SSL證書問題,請驗證CA證書是否正常」。HTTPS站點上cURL錯誤60的可能原因是什麼?
我已經將CURLOPT_CAINFO設置爲pem文件(也嘗試過crt),並且在嘗試訪問pem文件時檢查權限不足。
下面的代碼的方式:
$url = 'https://example.com/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_CAINFO, "/usr/local/apache2/htdocs/server/html/cacert.pem");
$response = curl_exec($ch);
...do something
curl_close($ch);
http://flwebsites.biz/posts/how-fix-curl-error-60- ssl問題 – SpYk3HH