How to fix SSL problem with wp plugin on localhost

46 Likes Comment

If you’re on the way to POC new features of your website on localhost, of course the website base on wordpress . I bet that you’ll meet this error for sure: Failure: cURL error 60: SSL certificate problem: self signed certificate in cert

How to deal with this error. Just create a folder named “mu-plugins” under the wp-content/ folder. Then create a file named “disable-ssl-verification.php” with the following code:

<?php

/**
 * Plugin Name: Disable SSL Verification
 * Description: WordPress themes and plugin can't be updated when using a self-signed SSL certificate. This plugin disables SSL verification if the WordPress site is loaded using a <code>.test</code> domain.
 * Version: 1.0.0
 * Author: Ryan Sechrest
 */

if (!isset($_SERVER['SERVER_NAME'])) {
    return;
}
if (!str_ends_with($_SERVER['SERVER_NAME'], '.test')) {
    return;
}
add_filter('https_ssl_verify', '__return_false');

Save and enjoy.

You might like

About the Author: Toc Xoan

This guy likes taking photos, hunting cheap tours, exploring the unique culture of every cities of Vietnam. Contact: [email protected]. I've created a dogecoin wallet to receive blog funding: DE6F5FisSCy7yz5rpHY1ChMSGYnDMpFZ1Q

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.