Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are setting up WPML on your localhost WordPress site and encountered a connection error: 'Unable to get data from service. Detailed error: cURL error 60: SSL certificate problem: self-signed certificate in certificate chain.' You are looking for a way to resolve or bypass the SSL certificate issue on a localhost setup.
Solution:
The issue you're facing with cURL error 60 is a common SSL verification problem in PHP applications like WordPress when making HTTPS requests without being able to verify the SSL certificate of the remote server. Here are some steps you can take:
1. Temporarily disable SSL verification while working locally. Ensure to use a proper certificate when moving to production.
2. For a quick workaround during development, you can disable SSL verification in WordPress by adding the following to your theme’s functions.php file:

add_action('http_api_curl', function($handle) {<br />    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);<br />    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);<br />}, 10, 1);

3. Alternatively, force WordPress to ignore SSL issues by adding these lines to your wp-config.php:

define('WP_HTTP_BLOCK_EXTERNAL', false);<br />define('WP_ACCESSIBLE_HOSTS', 'api.wordpress.org, *.wpml.org');

These solutions are intended for development environments and have not been tested extensively as they fall outside the typical scope of WPML support.

Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 1 reply, has 0 voices.

Last updated by Bruno Kos 4 months, 2 weeks ago.

Assisted by: Bruno Kos.

Author Posts
February 20, 2025 at 9:56 am #16728556

yevheniyaH

Background of the issue:
I am trying to set up WPML on my localhost WordPress site, which is currently under development. I am following the installation guide.

Symptoms:
I encountered a connection error: 'Unable to get data from service. Detailed error: cURL error 60: SSL certificate problem: self-signed certificate in certificate chain.'

Questions:
How can I resolve the cURL error 60 related to the SSL certificate?
Is there a way to bypass the SSL certificate issue on a localhost setup?

February 20, 2025 at 11:36 am #16729233

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

cURL error 60: SSL certificate problem: self-signed certificate in certificate chain is not specifically a WPML issue. It is a general cURL SSL verification issue that occurs when a PHP application (like WordPress) tries to make an HTTPS request but cannot verify the SSL certificate of the remote server.

The easiest solution is temporarily disabling SSL verification while working locally, then using a proper certificate when deploying to production.

Other than that you can try this:
https://wpml.org/faq/automatic-wpml-registration-using-php-for-easy-moves-between-production-development-and-staging/#how-do-i-set-a-different-site-key-for-each-environment

If you just need a quick workaround for development, you can disable SSL verification in WordPress by adding this to your theme’s functions.php file, something like:

add_action('http_api_curl', function($handle) {
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
}, 10, 1);

Or you can force WordPress to ignore SSL issues by adding this to wp-config.php:

define( 'WP_HTTP_BLOCK_EXTERNAL', false );
define( 'WP_ACCESSIBLE_HOSTS', 'api.wordpress.org, *.wpml.org' );

There are other possible solutions such as updating your your CA certificate bundle, etc.

I haven't tested any of this though, as this is outside of the WPML scope, so it may not work.