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. git-svn-id: https://develop.svn.wordpress.org/trunk@46231 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e6ea695f5a
commit
144c5f760d
@ -95,6 +95,8 @@ class WP_Site_Health_Auto_Updates {
|
|||||||
$headers = array(
|
$headers = array(
|
||||||
'Cache-Control' => 'no-cache',
|
'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.
|
// Include Basic auth in loopback requests.
|
||||||
if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
|
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' )
|
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 ) ) {
|
if ( is_wp_error( $test ) ) {
|
||||||
return array(
|
return array(
|
||||||
|
@ -1677,6 +1677,8 @@ class WP_Site_Health {
|
|||||||
'Cache-Control' => 'no-cache',
|
'Cache-Control' => 'no-cache',
|
||||||
'X-WP-Nonce' => wp_create_nonce( 'wp_rest' ),
|
'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.
|
// Include Basic auth in loopback requests.
|
||||||
if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
|
if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
|
||||||
@ -1693,7 +1695,7 @@ class WP_Site_Health {
|
|||||||
$url
|
$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 ) ) {
|
if ( is_wp_error( $r ) ) {
|
||||||
$result['status'] = 'critical';
|
$result['status'] = 'critical';
|
||||||
@ -2000,6 +2002,8 @@ class WP_Site_Health {
|
|||||||
$headers = array(
|
$headers = array(
|
||||||
'Cache-Control' => 'no-cache',
|
'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.
|
// Include Basic auth in loopback requests.
|
||||||
if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
|
if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
|
||||||
@ -2008,7 +2012,7 @@ class WP_Site_Health {
|
|||||||
|
|
||||||
$url = admin_url();
|
$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 ) ) {
|
if ( is_wp_error( $r ) ) {
|
||||||
return (object) array(
|
return (object) array(
|
||||||
|
Loading…
Reference in New Issue
Block a user