Suddenly getting the following error.
Error: SSL: no alternative certificate subject name matches target host name ‘api.companieshouse.gov.uk’
Nothing has changed in my source code and this has been working smoothly for over a year up until last week.
$query = curl_init();
curl_setopt($query, CURLOPT_URL, “https://api.companieshouse.gov.uk/search?q=$search&start_index=0”);
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_CUSTOMREQUEST, “GET”);
curl_setopt($query, CURLOPT_USERPWD, $api_key);
curl_setopt($query, CURLINFO_HEADER_OUT, true);
$result = curl_exec($query);
if (curl_errno($query)) {
echo 'Error: ’ . curl_error($query);
}
curl_close ($query);
$result = json_decode($result, true);
Any input greatly appreciated.