Laravel 使用GuzzleHttp請求第三方https接口報錯

錯誤提示:
     cURL error 60: Peer's certificate issuer has been marked as not trusted by the user. (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

解決方法

$client->setDefaultOption('verify', false);

或者

# 證書 https://github.com/guzzle/guzzle/blob/4.2.3/src/cacert.pem
$client = new \GuzzleHttp\Client(['verify' => '/full/path/to/cert.pem']);

 或者

# 證書 https://github.com/guzzle/guzzle/blob/4.2.3/src/cacert.pem
$client = new \GuzzleHttp\Client(['verify' => 'false]);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章