Are you seeing 'Unable to establish secure connection error' in WordPress? It is a common WordPress error and usually occurs when you are trying to install or update a WordPress plugin or theme from the official WordPress.org directory. In this article, we will show you why this error occurs and how to easily fix secure connection error in WordPress.
WordPress comes with a built-in system for managing updates. This system regularly checks for updates and shows notifications for you to install theme/plugin updates.
However, you must connect to the WordPress.org website to check for or install updates. Due to some configuration errors on the WordPress hosting server, your website may not be able to connect with the WordPress.org website.
This will result in a secure connection error, and you will see an error message like this:
With that being said, let’s see how to easily fix secure connection error in WordPress.
There are several ways to fix the unexpected secure connection error in WordPress. You can try one of the following solutions based on your situation.
If your shared hosting server is under a DDoS attack, it is likely that the connection to WordPress.org times out, which will cause the secure connection error.
In that case, you can wait a few minutes and try again. If the error persists, you should contact the web hosting company's support team.
VPS server or cloud connectivity problem
If you are on a cloud or VPS server, your server may not be able to connect to WordPress.org due to some DNS issues.
In that case, you can point your server directly to the WordPress.org servers. You will need to connect to your server using SSH.
SSH is short for secure shell, which is an encrypted protocol that allows you to connect to your server using command line tools.
Windows users can use a tool called PuTTy while Mac/Linux users can use the terminal app.
You will need login credentials for the account with shell access to your hosting account. You can get this information from your hosting account's cPanel control panel or check with your web hosting server provider.
In the terminal, you can connect to your server like this:
ssh [email protected]
Don't forget to replace username with your own username and example.com with your own domain name.
Once connected, you need to run the following command:
sudo nano / etc / hosts
This will open a file and you will need to add the following code at the bottom of the file:
66.155.40.202 api.wordpress.org
You can now save your changes and exit the editor. Please visit their website to see if this resolved the error.
If you are running WordPress on your own computer (localhost), you may not have the cURL extension enabled for PHP. This extension is required to access WordPress.org for updates.
You will need to edit the php.ini file on your computer. This file is usually located in the PHP folder of your Mamp, Xampp, or WAMP folder.
If you're on a Windows computer, find the following line:
; extension = php_curl.dll
Mac and Linux users should look for this line:
; extension = curl.so
Now you need to remove the semicolon before the text to enable the extension. Don't forget to save your php.ini file.
Finally, don't forget to restart the Apache server for the changes to take effect.
Check open ports in Firewall
If the cURL extension is correctly installed on your local server, the next step is to check the firewall of your Internet connection.
Your computer's firewall may be blocking outgoing connections from the local server to WordPress.org. If you're on Windows, press the start button and search for Windows Firewall. Mac users can find firewall settings in System Preferences »Security &Privacy
You must add Apache to your firewall's allowed programs and allow incoming and outgoing connections.
You will need to restart Apache for the changes to take effect.
We hope this article helped you to resolve the WordPress secure connection error. You may also want to check out our step-by-step guide to WordPress security for beginners.
If you enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Facebook.