Created
December 20, 2011 07:13
-
-
Save chrisguitarguy/1500624 to your computer and use it in GitHub Desktop.
Allow the WordPress HTTP api to make requests to github (bypassing SSL issues due to host configuration)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Fix SSL for Github | |
Plugin URI: http://www.christopherguitar.net/ | |
Description: Allow unverified SSL certificates from github only. | |
Author: Christopher Davis | |
Author URI: http://www.christopherguitar.net/ | |
License: GPL2 | |
*/ | |
add_action('http_request_args', 'cd_allow_github_ssl', 10, 2); | |
function cd_allow_github_ssl( $args, $url ) | |
{ | |
if( preg_match( '#^https://github.com#i', $url ) ) | |
{ | |
$args['sslverify'] = false; | |
} | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment