Roy-Try-Catch
← Back to list

【Laravel】SSL certificate problem: unable to get local certificate issuer

Roy • Updated 2026-10-15 14:52:34

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);

Comments

No comments yet.

請先登入