Laravel 使用GuzzleHttp请求第三方https接口报错

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/qq_27295403/article/details/92830567

错误提示:
     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]);

猜你喜欢

转载自blog.csdn.net/qq_27295403/article/details/92830567
今日推荐