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

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

Previous topic - Next topic

StrangerTopic starter

My website is based on WordPress.
Through the REST API, WordPress and other applications can communicate with each other. This feature is used by the block editor screen to modify and save posts and pages on the website.
Despite receiving an error message indicating failure to access the REST API, I am still able to use it.
The error message specifically mentions an inability to locate the local certificate.
Do you have any suggestions for resolving this issue?
  •  

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);
  •  

Kardarorce

One possible solution is to check if the SSL certificate on your WordPress site is valid and properly installed. You can do this by visiting your website using HTTPS and checking if the SSL certificate is displayed as trusted.

If there is an issue with the SSL certificate, you may need to contact your hosting provider or SSL certificate provider for assistance in resolving the problem. They can guide you through the process of installing or renewing the certificate correctly.

Another suggestion is to make sure that the REST API is enabled and properly configured in your WordPress settings. You can check this by going to the "Settings" section in your WordPress dashboard and ensuring that the "Permalinks" option is set to something other than the default.

The error message "cURL error 60: SSL problem: unable to get local issuer certificate" usually occurs when cURL is unable to verify the SSL certificate of the target server. Here are a few potential solutions you can try:

1. Update the CA bundle: Download an updated CA bundle (a collection of trusted root certificates) and ensure that it is correctly configured in your PHP.ini file. You can obtain the latest CA bundle from the cURL website (https://curl.haxx.se/docs/caextract.html).

2. Enable the "verify_peer" and "verify_peer_name" options: In your cURL request, set the options "CURLOPT_SSL_VERIFYPEER" and "CURLOPT_SSL_VERIFYHOST" to true. This instructs cURL to verify the SSL certificate on each request.

3. Disable SSL certificate verification (not recommended): While this is not a recommended solution for security reasons, you can choose to disable SSL certificate verification by setting the "CURLOPT_SSL_VERIFYPEER" and "CURLOPT_SSL_VERIFYHOST" options to false. However, be aware that this leaves your requests vulnerable to man-in-the-middle attacks.

4. Contact your hosting provider: If you have tried the above steps and are still experiencing issues, it may be worth reaching out to your hosting provider or system administrator for further assistance. They may be able to help with any server-side configuration issues or provide guidance on resolving the SSL certificate problem.


If you are experiencing the "cURL error 60: SSL problem: unable to get local issuer certificate" specifically within the context of WordPress, there are a few additional steps you can take:

1. Verify the SSL certificate installation: Ensure that the SSL certificate is properly installed on your server and that its associated intermediate and root certificates are correctly configured. You may need to contact your SSL certificate provider or hosting provider for assistance with this.

2. Check the SSL configurations in your WordPress site: Verify that your WordPress site's URL is using the correct protocol (HTTP or HTTPS) in the settings. If it's set to HTTPS, ensure that both the WordPress Address (URL) and Site Address (URL) in the General Settings point to the correct secure URL.

3. Check your .htaccess file: Make sure your .htaccess file is not interfering with SSL. Sometimes, certain directives or rules in the .htaccess file can cause conflicts with SSL certificate verification. Consider temporarily disabling or modifying any relevant rules to see if it resolves the issue.

4. Update your WordPress plugins and themes: Outdated or incompatible plugins or themes could potentially cause conflicts with the REST API and SSL certificate verification. Ensure that all your plugins and themes are up to date and compatible with your WordPress version.

5. Test with a default theme and minimal set of plugins: Temporarily switch to a default WordPress theme (e.g., Twenty Twenty-One) and disable all non-essential plugins. This can help determine if any theme or plugin is causing the SSL verification issue.

6. Consult with technical support: If the issue persists, it may be beneficial to contact both your hosting provider's technical support and the developers of any relevant plugins or themes for further assistance. They will have more insight into the specific setup and configuration of your WordPress site.
  •