If the ‘Unable to establish secure connection error’ is creating a hindrance for you in installing or updating a WordPress plugin or theme from the official wordPress.org directory in WordPress, we are here to help. The ‘Unable to establish secure connection error’ is a standard WordPress error. We will first discuss all the probable causes of this type of WordPress error and then discuss the popular solutions for such errors in WordPress.
Causes of the ‘Unable to Establish Secure Connection Error’ in WordPress:
A built-in system in WordPress manages updates by regularly inspecting them. It also displays notifications if it founds any updates available for your installed plugins or theme. This built-in feature checks for updates or installs them via the WordPress.org website. Whatever may be the reason, the failure of your website to connect to the WordPress.org website will hinder the functioning of this built-in system. This may happen because of some misconfiguration on your WordPress hosting server that in return causes a secure connection error.
Error Message:
The secure connection error message might look like this:
An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /home/username/public_html/wp-admin/includes/update.php on line 122
Resolving the Secure Connection Error in WordPress:
In WordPress, the secure connection error can be determined using multiple methods. We will discuss all the popular solutions for this type of WordPress error.
Method 1: Resolving the Hosting and Server-Related Issues:
If your connection to WordPress.org is facing the timeout error which is further causing the secure connection error, there is an excellent chance of your shared hosting server being under DDoS attack. In such a case, it is suggested to wait for some time. If the error gets resolved, then it is just a temporary issue. If it exists, you can contact your hosting service provider for further assistance and guidance to resolve the issue.
Method 2: Resolving Cloud or VPS Server Connectivity Issue:
One of the reasons behind the secure connection error could be some DNS issues. This could be the case if you are on a cloud or VPS hosting and there is some hindrance in connecting your server to the WordPress website.
If this is the case for you, you can check the below steps:
- Try pointing your server directly to WordPress.org servers by connecting to your server using SSH i.e. secure shell.
- Using SSH you can connect to your server using command line tools.
- In simple words, you can understand a secure shell as an encrypted protocol.
- For Windows:
- Use the PuTTy tool
- For Mac / Linux users:
- Use the terminal app
- Visit the Cpanel dashboard of your hosting account for the login credentials for the version with shell access to your hosting account.
- You can also take help from your hosting service provider.
- Open the terminal.
- Connect to your server:
- In the above code, replace your username and “domain” with your domain name.
- You are now connected.
- Now, run the below command:
- sudo nano /etc/hosts
- A file will open.
- Go to the bottom of the file.
- Add the below code.
- 66.155.40.202 api.wordpress.org
- Save your changes.
- Go to your website.
- The error should be resolved by now.
Method 3: Resolving the WordPress Secure Connection Error on Localhost:
Are you facing a secure connection error while running WordPress on your local host, i.e., your computer? Then all you are suggested to do is to enable the extension required to access WordPress.org for updates, i.e., the cURL extension for PHP. For this, you can follow the below steps:
- Open the PHP folder of your Mamp, Xampp, or WAMP folder.
- Locate the php.ini file on your computer.
- Edit the php.ini file on your computer.
- Locate the below line in the php.ini file:
- For Windows:
- ;extension=php_curl.dll
- For Mac and Linux:
- ;extension=curl.so
- For Windows:
- Remove the semicolon from the above code.
- Save your php.ini file.
- Restart the Apache server.
- The changes made and saved will then take effect and will enable the cURL extension.
Method 4: Resolving the secure connection error through the Open Ports in Firewall:
Now that you have confirmed that the cURL extension is installed and enabled on your local server and if the secure connection error still persists, then you can check this method.
Here, you will have to check your internet connection firewall. We are suggesting this step because there is a possibility that the firewall of your system might be blocking outgoing connections from the local server to WordPress.org.
To move ahead with this method, you can follow the below steps:
- For Windows:
- Press the start button.
- Locate the Windows Firewall.
- For Mac:
- Go to System Preferences » Security & Privacy.
- Locate the firewall settings.
- Add Apache to the allowed programs of your firewall.
- Allow incoming and outgoing connections.
- Restart Apache.
- The changes made and saved will thus take effect.
We hope that the above-mentioned methods would resolve the secure connection for you. You can also check our other articles on WordPress Errors.