laravel : cURL error 60: SSL certificate unable to get local issuer certificate

后端 未结 3 569
不思量自难忘°
不思量自难忘° 2021-01-07 15:17

Ubuntu: 15.04

Laravel: 5.4.32

GuzzleHttp\\Guzzle: ~6.0

Hi there

I have the following error when I am trying to reset a password using Laravel

3条回答
  •  耶瑟儿~
    2021-01-07 15:45

    Add cacert.pem file in your project, download file from

    https://curl.haxx.se/ca/cacert.pem

    copy that downloaded the certificate in your /vendor/guzzlehttp/guzzle/src folder. change file Client.php find the function called getDefaultOptions()

    replace $settings array with this,

    $settings = [
            'allow_redirects' => true,
            'exceptions'      => true,
            'decode_content'  => true,
            //'verify'          => true
            'verify'          => dirname(__FILE__).'/cacert.pem',
    ];
    

    what I did is for verifying added the downloaded file configuration, just changed the value for verify.

    if you want to send curl request insecurely you can disable SSL certificate check, by setting verify => false

    Warning: This makes the request absolute insecure

提交回复
热议问题