How to Fix Common SSL Issues in WordPress like NET::ERR_CERT_INVALID?

fix ssl issues in wordpress

SSL (Secure Sockets Layer) certificates are crucial in safeguarding your WordPress site by encrypting data and providing a secure connection for your visitors.

However, setting up SSL can sometimes lead to unexpected issues affecting your site’s functionality and user experience.

Whether facing the dreaded ‘Mixed Content’ error, struggling with redirect loops, or dealing with certificate expiration notices, these common SSL challenges can be daunting for any WordPress site owner.

5 Common Causes for SSL Issues

  • Mixed Content: Mixed content issues happen when your website has both HTTP and HTTPS resources.
  • Expired SSL Certificate Regularly monitor your SSL certificate’s expiration date and renew it promptly to prevent security lapses.
  • Too Many Redirect Errors – Investigate and rectify excessive redirection issues to ensure a seamless and secure browsing experience.
  • NET::ERR_CERT_INVALID Error Address this error by confirming that your SSL certificate is valid and matches your domain, eliminating user trust issues.
  • Inadequate SSL Key Length Verify that your SSL certificate employs an adequate key length for security.

How to Troubleshoot Common SSL Issues?

1. Manually Fixing Mixed Content Error

This method proves more efficient and enhances your website’s performance, yet necessitates manual problem-solving.

  1. Access your WordPress dashboard.
Wordpress Dashboard
  1. Navigate to Settings » General and ensure that both the ‘WordPress Address’ and ‘Site Address’ options contain HTTPS URLs.
Set WordPress Address and Site Address to fix ssl issue
  1. When you find ‘http’ URLs, switch them to ‘https’ and click ‘Save Changes’ to save your settings.
Save Changes

Afterward, locate the outdated HTTP URLs in your WordPress database and substitute them with the updated HTTPS URLs. Achieve this effortlessly by installing and activating the Better Search Replace plugin.

Once activated, navigate to the Tools » Better Search Replace page. In the ‘Search’ field, input your website URL with HTTP, and in the ‘Replace’ field, enter your website URL with ‘https.’

Better Search Replace Dashboard

The plugin will proceed to modify URLs within your WordPress database.

Follow these steps to fix mixed content errors, enhance your WordPress site’s security, and avoid browser security warnings. Maintain HTTPS for a secure visitor experience.

2. Expired SSL Certificate

An SSL certificate has a validity period, typically one to two years, and your website becomes insecure when it expires. Renew your SSL certificate through your certificate authority (CA) or hosting provider. Install the new certificate on your web server.

3. Too Many Redirect Errors When Migrating to SSL/HTTPS

Here’s a step-by-step guide on how to fix “Too Many Redirects” errors after moving to SSL/HTTPS via cPanel:

  1. Log in to your cPanel account using your username and password.
Cpanel Login Page
  1. In cPanel, locate and click on the “File Manager” icon, usually found in the “Files” section.
File Manager
  1. In the “File Manager,” navigate to the root directory of your WordPress installation. This is typically located in the “public_html” folder.
Public HTML
  1. Look for the wp-config.php file in your root directory. Right-click on it and select “Edit” or “Code Edit” from the menu.
Wp Config File
  1. The file will open in a text editor within cPanel, then Insert the following line of code just before the line that says /* That's all, stop editing! Happy publishing. */:
  2. After adding the line of code, click the “Save Changes” button at the top right corner of the editor.
PHP
define('FORCE_SSL_ADMIN', true);
force ssl
  1. Visit your website using the HTTPS version (https://yourdomain.com). Ensure you no longer encounter the “Too Many Redirects” error.

Adding define('FORCE_SSL_ADMIN', true); to wp-config.php instructs WordPress to enforce SSL/HTTPS for the admin area, resolving redirect issues. Ensure your SSL certificate is correctly installed and configured on your hosting for it to work.

4. NET::ERR_CERT_INVALID error

The Google Chrome browser displays the error message “NET::ERR_CERT_INVALID,” while other browsers show a similar warning message indicating that the connection to your website is insecure.

NET::ERR_CERT_INVALID Error

This error message signifies that the user’s browser rejected the certificate offered by the website. Various factors could contribute to this occurrence, including:

  1. The certificate has reached its expiration date.
  2. Your browser does not trust the authority that issued the certificate.
  3. The SSL certificate has been issued for an alternate domain name or subdomain.

If you obtained an SSL certificate and requested your WordPress hosting provider to handle the installation, you can contact them for assistance in resolving the issue.

If you manually install the SSL certificate, consider reinstalling it or contact your SSL certificate provider for troubleshooting assistance.

5. Inadequate SSL Key Length

Short or weak SSL key lengths can compromise the security of your SSL certificate. Generate a new SSL certificate with a more robust key length (at least 2048 bits) to enhance security.

Conclusion

In conclusion, addressing common SSL issues is crucial for maintaining a secure website. Following the steps outlined in this guide, website owners can enhance security, protect user data, and build trust with their audience. A secure website is not just necessary; it’s a cornerstone of online success.