Make WordPress Core

Changeset 46231


Ignore:
Timestamp:
09/21/2019 04:05:13 PM (7 years ago)
Author:
ocean90
Message:

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.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php

    r45932 r46231  
    9696                        'Cache-Control' => 'no-cache',
    9797                );
     98                /** This filter is documented in wp-includes/class-wp-http-streams.php */
     99                $sslverify = apply_filters( 'https_local_ssl_verify', false );
    98100
    99101                // Include Basic auth in loopback requests.
     
    109111                );
    110112
    111                 $test = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );
     113                $test = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );
    112114
    113115                if ( is_wp_error( $test ) ) {
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r45932 r46231  
    16781678                        'X-WP-Nonce'    => wp_create_nonce( 'wp_rest' ),
    16791679                );
     1680                /** This filter is documented in wp-includes/class-wp-http-streams.php */
     1681                $sslverify = apply_filters( 'https_local_ssl_verify', false );
    16801682
    16811683                // Include Basic auth in loopback requests.
     
    16941696                );
    16951697
    1696                 $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );
     1698                $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );
    16971699
    16981700                if ( is_wp_error( $r ) ) {
     
    20012003                        'Cache-Control' => 'no-cache',
    20022004                );
     2005                /** This filter is documented in wp-includes/class-wp-http-streams.php */
     2006                $sslverify = apply_filters( 'https_local_ssl_verify', false );
    20032007
    20042008                // Include Basic auth in loopback requests.
     
    20092013                $url = admin_url();
    20102014
    2011                 $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );
     2015                $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );
    20122016
    20132017                if ( is_wp_error( $r ) ) {
Note: See TracChangeset for help on using the changeset viewer.