Error SSL certificate problem: unable to get local certificate issuer
在 Laravel 實作 LINE Bot SDK 的推播測試時,遇到以下錯誤:
SSL certificate problem: unable to get local certificate issuer
這是 curl 對外連線時,因為憑證驗證失敗所導致的問題。
解決方法
方案一
下載 cacert.pem,並在 php.ini 設定其路徑:
# php.ini
curl.cainfo="{{pem_path}}"
openssl.cafile="{{pem_path}}"
方案二
curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
No comments yet.