Skip to content

Commit

Permalink
Merge pull request #398 from rrikesh/master
Browse files Browse the repository at this point in the history
Prevent Fatal Errors with unverified certificates - Fix #379
  • Loading branch information
rosell-dk authored Jun 26, 2020
2 parents cee214b + 4ca0978 commit efb3c77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/classes/SelfTestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ public static function remoteGet($requestUrl, $args = [], $maxRedirects = 2)
$log = [];
$args['redirection'] = 0;

if (defined('WP_DEBUG') && WP_DEBUG ) {
$args['sslverify'] = false;
}

$log[] = 'Request URL: ' . $requestUrl;

$results = [];
Expand All @@ -200,7 +204,7 @@ public static function remoteGet($requestUrl, $args = [], $maxRedirects = 2)
$log[] = 'The remote request errored';
return [false, $log, $results];
}
if (!isset($wpResult['headers'])) {
if (!is_wp_error($wpResult) && !isset($wpResult['headers'])) {
$wpResult['headers'] = [];
}
$results[] = $wpResult;
Expand Down

0 comments on commit efb3c77

Please sign in to comment.