Gusle Fail in run HTTP Request - PullRequest
       57

Gusle Fail in run HTTP Request

1 голос
/ 06 августа 2020

Я получаю эту ошибку при запуске своего задания:

GuzzleHttp/Exception/RequestException with message 'cURL error 77: error setting certificate verify locations:*emphasized text*
  CAfile: /tmp/curl_haxx_se_ca_cacert_pem.pem
  CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)'

Пожалуйста, помогите мне

1 Ответ

0 голосов
/ 06 августа 2020

Я нашел это решение: https://github.com/guzzle/guzzle/issues/1935#issuecomment -629548739

Используйте 'verify => false'

$client = new Client([
      'base_uri'        => 'https://api.target'
      'verify'          => false, //https://github.com/guzzle/guzzle/issues/1935#issuecomment-629548739
      'headers'         => [
       //Your header here
  ]
]);

, если вы используете http (Illuminate \ Support \ Фасады \ Http) https://laravel.com/docs/7.x/http-client#guzzle -опции


$response   = Http::withOptions([ //use this method
                'verify'     => false, //This key and value in this method
            ])->withHeaders([
                'Content-Type'  => 'application/json',
                'Accept'        => 'application/json',
            ])->get($url);
return $response;
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...