How To Fix Secure Connection Error In WordPress

How To Fix Secure Connection Error In WordPress

Have you ever faced a ‘Unable to establish secure connection error’ while installing WordPress plugin or updating themes from WordPress.org directory ?

The WordPress secure connection error usually occurs when you’re trying to install or update plugins and themes from WordPress.org.

If you ever run into it, you’ll see a message much like the one below. Due to the incorrect config, it fails to connect to the WordPress.org website.

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 117

The above is a message you will get if you are unable to establish a secure connection error.

Step 1:

There are different situations where you can encounter this error. It may occur if your hosting server is under DDOS attack. During such attacks, the connection with wordpress.org will possibly timeout causing the secure connection error.

This issue usually solves itself after some time of the attack. If the error continues, you need to contact your web hosting support team.

How To Fix Secure Connection Error In WordPress

Step 2:

This issue is also likely to occur if your website is on cloud or VPS hosting due to DNS issues. To fix this, you need to connect to your server using SSH. After connecting to your server, you need to open the Hosts file.

In Windows, you can use a Putty app whereas Mac Users can use the terminal to connect to their server.

ssh test@example.com
#for mac users

Here, test is the username and example.com is the domain name. After connecting to the server, you can open the hosts file using the following command

sudo nano /etc/hosts

Step 3:

In your hosts file, you need to hardcode the IP address of the wordpress.org.

66.155.40.202 api.wordpress.org

The goal here is to ensure your hosts file is mapping WordPress.org to the correct IP address. To do that, we’re going to add an extra line to the file.
Save your hosts file and exit the editor. Now you can visit the website and see if the problem has been fixed or not.

Step 4:

You can also face this issue if your server uses a firewall. If it does, you need to make sure it doesn’t block the ports used by the apps. Usually, Apache nginx use port 80 or 8080.

Step 5:

WordPress is built on PHP, so if you don’t have the correct version installed or some unnecessary extensions in place, it might not work as expected. cURL is a PHP extension that enables you to transfer files using the command line. You need cURL for WordPress to be able to download plugins from the official repository or update themes. Using SSH, you can execute the following command:

sudo nano
/etc/php.ini

If you’re a Windows user, look for the following line within the file:

;extension=php_curl.dll

The line looks slightly different for Linux users:

;extension=curl.so

If these lines are not present in php.ini, add them. Now save the changes to php.ini and restart your server. This will force the file to load again, removing the error.

Conclusion

By checking the above methods, you can now successfully resolve the “Unable to establish secure connection” error in your WordPress website.

Check out these top 3 WordPress hosting services:

A2 Hosting
$2.99 /mo
Starting price
Visit A2 Hosting
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.8
  • Pricing
    4.0
Hostinger
$2.99 /mo
Starting price
Visit Hostinger
Rating based on expert review
  • User Friendly
    4.7
  • Support
    4.7
  • Features
    4.8
  • Reliability
    4.8
  • Pricing
    4.7
HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0

How to Configure WordPress Page Caching

A savvy website owner understand how important it is to have a website with a qu
4 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How to Secure Your WordPress Website

Millions of websites get hacked every year and many people consider WordPres
5 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Create a WordPress Child Theme

Customizing your WordPress theme but want to be extremely safe? Don’t worry. W
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to Fix File and Folder Permissions Errors in WordPress

It's so frustrating when you receive an error while updating your website. File
4 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top