Skip to content

Instantly share code, notes, and snippets.

@chrisguitarguy
Created December 20, 2011 07:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisguitarguy/1500624 to your computer and use it in GitHub Desktop.
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)
<?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