cURL error 60: SSL certificate in Laravel 5.4

后端 未结 8 872
有刺的猬
有刺的猬 2020-12-02 20:47

Full Error

RequestException in CurlFactory.php line 187: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see ht

8条回答
  •  -上瘾入骨i
    2020-12-02 21:27

    I was sending a request from domain X to Y, my problem was with the certificate used on the domain Y (it wasn't a self-signed cert btw), the domain belonged to me & I had the certificate, so the quick fix was to use the domain Y's certificate on domain X's application:

    On domain X:

    • Using Laravel 7 HTTP wrapper:

      \Http::withOptions(['verify' => 'path-to-domain-Y-certificate']);

    • Using guzzle:

      new GuzzleHttp\Client(['verify' => 'path-to-domain-Y-certificate']);

    OR you could just contact your SSL provider to resolve the issue.

    Note: Storing your domain's certificate in another system isn't a secure method, use this method only if you can ensure your certificate's security.

    I haven't found what was wrong with the certificate, no browser seemed to have a problem with it, the only problem was generated on laravel using curl.

提交回复
热议问题