'Uncaught GuzzleHttp\Exception\RequestException: cURL error 60 in php [duplicate]
I am trying to get data via php api but i am getting following error message in my wampp server
Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.opensea.io/api/v1/asset/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/1/
GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.opensea.io/api/v1/asset/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/1/ in C:\wamp64\www\opensea\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 211
Here is my code which giving me error,How can i fix this issue
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.opensea.io/api/v1/asset/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/1/');
echo $response->getBody();
Solution 1:[1]
It's because of SSL certificate, try this option:
$client = new \GuzzleHttp\Client( [ 'curl' => [CURLOPT_SSL_VERIFYPEER => false ] ] );
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Saeed.Modarresi |
