Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add filter for sslverify on zip url #20

Merged
merged 2 commits into from

2 participants

@sc0ttkclark

the zip_url never gets the sslverify setting passed from this plugin, because it's not hooked into at the point when it's run. This addition will set sslverify to the config settings when WP goes to download the ZIP. Otherwise, sslverify defaults to true and fails on certain hosts that have no idea what the GitHub SSL certificate is (lol).

Props to @pglewis for digging so deep to find this fix.

@jkudish jkudish merged commit de24b4a into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 15, 2012
  1. @sc0ttkclark
  2. @sc0ttkclark
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 0 deletions.
  1. +18 −0 updater.php
View
18 updater.php
@@ -71,6 +71,9 @@ public function __construct( $config = array() ) {
// set timeout
add_filter( 'http_request_timeout', array( $this, 'http_request_timeout' ) );
+
+ // set sslverify for zip download
+ add_filter( 'http_request_args', array( $this, 'http_request_sslverify' ), 10, 2 );
}
@@ -119,6 +122,21 @@ public function http_request_timeout() {
return 2;
}
+ /**
+ * Callback fn for the http_request_args filter
+ *
+ * @param $args
+ * @param $url
+ *
+ * @return mixed
+ */
+ public function http_request_sslverify ( $args, $url ) {
+ if ( $this->config[ 'zip_url' ] == $url )
+ $args[ 'sslverify' ] = $this->config[ 'sslverify' ];
+
+ return $args;
+ }
+
/**
* Delete transients (runs when WP_DEBUG is on)
Something went wrong with that request. Please try again.