cURL error 60: SSL certificate problem: unable to get local issuer certificate

Started by Stranger, Jul 19, 2022, 06:29 AM

Previous topic - Next topic

StrangerTopic starter

My site is built on Wordpress.
The REST API is a way to communicate between WordPress and other applications. The block editor screen uses this feature to work on the posts and pages of the site. Also for saving.

I see a warning that the request to the REST API was unsuccessful. It shows some error, but it works.
The error is in the subject. Can't see the local certificate.
What should I do?
  •  

Ali_Pro

If the warning doesn't interfere with the editor, just disable SSL certificate verification. If I understand correctly, it does not affect the functionality of applications, just visually interferes?
It will be quite correct to download the latest version of the certificate from the CURL website, install it in the php extras\ssl directory. In php.ini, write the path.
After restarting apache everything will be fine.
Ali.
  •  
    The following users thanked this post: Sevad

StrangerTopic starter

Thank you! But I don't have access to the server, it's just a website hosted by a service provider. But I will definitely contact technical support so that they renew the certificate.
Just in case: maybe you have a solution to include some CMS plugin, or add entries to the host file?
  •  

Ali_Pro

There might be some plugin, but I don't know about it. Here the meaning is: You need to update the content of the *crt file to change it to the content of this file This can be done by hand.
a. Download the file from the link.
b. Update the content of the ca-bundle.crt file in the wp-includes directory, certificates folder with the content from the downloaded file. Enjoy!
Ali.
  •  

Mritunjay

You can simply disable SSL certificate verification. For example, like that:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://site.com');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$result = curl_exec($ch);
  •