0

I am trying to make an async guzzle call to 2 other APIs running on the same server. This way I just want to combine the 2 API calls running concurrently.

$params = []
$client = new Client(['base_uri' => 'https://test.local', 'cookies' => true]);

$promises = [
            'first' => $client->requestAsync($method, '/api/first', ['form_params' => $params]),
            'second' => $client->requestAsync($method, '/api/second', ['form_params' => $params]),
];

$responses = Utils::unwrap($promises);

But everytime I run this throws SSL certificate error Error: cURL error 60: SSL certificate problem: self-signed certificate This must be because of the same domains Client/Server.

Tried with tricking different domain name then working.

Note: The certificate.pem is installed and integrated in php.ini file. the SSL all working for other straight-forward calls. just not working for this particular case. curl.cainfo = "C:\laragon\etc\ssl\cacert.pem" in php.ini

Amit Shah
  • 7,771
  • 5
  • 39
  • 55
  • Does the answer here help? https://stackoverflow.com/questions/29822686/curl-error-60-ssl-certificate-unable-to-get-local-issuer-certificate You either need to to get an officially signed cert, or you need to install the generator of the cert as a trusted root authority, or you need to find a Guzzle / cURL / PHP switch or config that accepts self signed certificates, or you need to use HTTP instead of HTTPS – Nick.Mc Apr 11 '23 at 02:39
  • @Nick.McDermaid I forgot to mention. the certificate is already integrated. I updated my post with same note. – Amit Shah Apr 11 '23 at 02:42
  • So if you hit that URL directly (from the PHP server) using a browser you don't get any SSL error? – Nick.Mc Apr 11 '23 at 02:49
  • the first,second api call if i hit directly from the postman. working fine. yeh.. – Amit Shah Apr 11 '23 at 02:52

0 Answers0