From 123b4475b01d9199176fd2348c5350354d93eebd Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Sat, 21 Sep 2019 16:06:57 +0000 Subject: [PATCH] Site Health: Don't verify SSL certificate when testing the local site. The SSL certificate may be self-signed which prevents various tests from returning proper results. Since the Cron API and file editors don't verify the certificate the tests shouldn't either. Props Clorith, ocean90. Fixes #47957. Built from https://develop.svn.wordpress.org/trunk@46231 git-svn-id: http://core.svn.wordpress.org/trunk@46043 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-site-health-auto-updates.php | 4 +++- wp-admin/includes/class-wp-site-health.php | 8 ++++++-- wp-includes/version.php | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/class-wp-site-health-auto-updates.php b/wp-admin/includes/class-wp-site-health-auto-updates.php index d61ec1a002..bbd5479829 100644 --- a/wp-admin/includes/class-wp-site-health-auto-updates.php +++ b/wp-admin/includes/class-wp-site-health-auto-updates.php @@ -95,6 +95,8 @@ class WP_Site_Health_Auto_Updates { $headers = array( 'Cache-Control' => 'no-cache', ); + /** This filter is documented in wp-includes/class-wp-http-streams.php */ + $sslverify = apply_filters( 'https_local_ssl_verify', false ); // Include Basic auth in loopback requests. if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { @@ -108,7 +110,7 @@ class WP_Site_Health_Auto_Updates { admin_url( 'site-health.php' ) ); - $test = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) ); + $test = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) ); if ( is_wp_error( $test ) ) { return array( diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index 8ced4646bb..4e5b3c3bcc 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -1677,6 +1677,8 @@ class WP_Site_Health { 'Cache-Control' => 'no-cache', 'X-WP-Nonce' => wp_create_nonce( 'wp_rest' ), ); + /** This filter is documented in wp-includes/class-wp-http-streams.php */ + $sslverify = apply_filters( 'https_local_ssl_verify', false ); // Include Basic auth in loopback requests. if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { @@ -1693,7 +1695,7 @@ class WP_Site_Health { $url ); - $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) ); + $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) ); if ( is_wp_error( $r ) ) { $result['status'] = 'critical'; @@ -2000,6 +2002,8 @@ class WP_Site_Health { $headers = array( 'Cache-Control' => 'no-cache', ); + /** This filter is documented in wp-includes/class-wp-http-streams.php */ + $sslverify = apply_filters( 'https_local_ssl_verify', false ); // Include Basic auth in loopback requests. if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { @@ -2008,7 +2012,7 @@ class WP_Site_Health { $url = admin_url(); - $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) ); + $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) ); if ( is_wp_error( $r ) ) { return (object) array( diff --git a/wp-includes/version.php b/wp-includes/version.php index e22d5c3e03..99fa0ec44e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46230'; +$wp_version = '5.3-alpha-46231'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.