Answer the question
In order to leave comments, you need to log in
How to fix cURL error 51: SSL in Guzzle Yii 2?
I installed Guzzle in Yii 2 to send a request to an external partner site and receive a json response from there. But there was a problem. I write the following code:
$client = new Client();
$res = $client->request('GET', 'https://api.site.com');
echo $res->getStatusCode();
cURL error 51: SSL: no alternative certificate subject name matches target host name 'api.site.com' (see curl.haxx.se/libcurl/c/libcurl-errors.html)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question