The quick solution for localhost is to turn off the certificate verification using options in guzzle of verify
as false.
A quick small example below
use GuzzleHttpClient;
$client = new Client([
'base_uri' => 'http://exmaple.org'
]);
$client->request('GET', '/', ['verify' => false]);
If you are using Http-client provided by laravel you can add guzzle options like this,
$response = Http::withOptions([
'verify' => false,
])->get('http://example.org/');
NOTE:
Though even guzzle suggests to not using it, but if you are testing your own apis it can work.
Though you can simple add your certificates as per request just by providing path.
Mozilla provides a commonly used CA bundle which can be downloaded here (provided by the maintainer of cURL).
// Use a custom SSL certificate on disk.
$client->request('GET', '/', ['verify' => '/path/to/cacert.pem']);
Read more about certificates from https://curl.se/docs/sslcerts.html .
Read more about verify from guzzle docs verify
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…