Failed: Error Number: 60. Reason: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed原因是 ssl 無法驗証成功
解決方法一:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);解決方法二:
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
先用火狐或ie開啟連結,下載其 crt 檔,放到自已站中
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);缺點要自行注意到期日,重下新的 crt檔
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/path/download.crt");
參考連結:http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/
沒有留言:
張貼留言