Skip to content

Instantly share code, notes, and snippets.

@wapcrazut
Last active May 12, 2020 13:52
Show Gist options
  • Save wapcrazut/764e8015047cdd29c62cee3534931574 to your computer and use it in GitHub Desktop.
Save wapcrazut/764e8015047cdd29c62cee3534931574 to your computer and use it in GitHub Desktop.
Force Wordpress HTTP Requests to always verify SSL
<?php
// Add this to your child's theme functions file
// Source: https://surniaulula.com/2018/apps/wordpress/fix-sslverifyfalse-for-plugin-theme-update-checks/
add_filter( 'https_ssl_verify', '__return_true', PHP_INT_MAX );
add_filter( 'http_request_args', 'http_request_force_ssl_verify', PHP_INT_MAX );
function http_request_force_ssl_verify( $args ) {
$args['sslverify'] = true;
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment