Index: wp-includes/http.php
===================================================================
--- wp-includes/http.php	(revision 10529)
+++ wp-includes/http.php	(working copy)
@@ -228,19 +228,19 @@
 		static $working_transport, $blocking_transport, $nonblocking_transport;
 
 		if ( is_null($working_transport) ) {
-			if ( true === WP_Http_ExtHttp::test() && apply_filters('use_http_extension_transport', true) ) {
+			if ( true === WP_Http_ExtHttp::test($args) ) {
 				$working_transport['exthttp'] = new WP_Http_ExtHttp();
 				$blocking_transport[] = &$working_transport['exthttp'];
-			} else if ( true === WP_Http_Curl::test() && apply_filters('use_curl_transport', true) ) {
+			} else if ( true === WP_Http_Curl::test($args) ) {
 				$working_transport['curl'] = new WP_Http_Curl();
 				$blocking_transport[] = &$working_transport['curl'];
-			} else if ( true === WP_Http_Streams::test() && apply_filters('use_streams_transport', true) ) {
+			} else if ( true === WP_Http_Streams::test($args) ) {
 				$working_transport['streams'] = new WP_Http_Streams();
 				$blocking_transport[] = &$working_transport['streams'];
-			} else if ( true === WP_Http_Fopen::test() && apply_filters('use_fopen_transport', true) && ( isset($args['ssl']) && !$args['ssl'] ) ) {
+			} else if ( true === WP_Http_Fopen::test($args) ) {
 				$working_transport['fopen'] = new WP_Http_Fopen();
 				$blocking_transport[] = &$working_transport['fopen'];
-			} else if ( true === WP_Http_Fsockopen::test() && apply_filters('use_fsockopen_transport', true) && ( isset($args['ssl']) && !$args['ssl'] ) ) {
+			} else if ( true === WP_Http_Fsockopen::test($args) ) {
 				$working_transport['fsockopen'] = new WP_Http_Fsockopen();
 				$blocking_transport[] = &$working_transport['fsockopen'];
 			}
@@ -279,16 +279,16 @@
 		static $working_transport, $blocking_transport, $nonblocking_transport;
 
 		if ( is_null($working_transport) ) {
-			if ( true === WP_Http_ExtHttp::test() && apply_filters('use_http_extension_transport', true) ) {
+			if ( true === WP_Http_ExtHttp::test($args) ) {
 				$working_transport['exthttp'] = new WP_Http_ExtHttp();
 				$blocking_transport[] = &$working_transport['exthttp'];
-			} else if ( true === WP_Http_Curl::test() && apply_filters('use_curl_transport', true) ) {
+			} else if ( true === WP_Http_Curl::test($args) ) {
 				$working_transport['curl'] = new WP_Http_Curl();
 				$blocking_transport[] = &$working_transport['curl'];
-			} else if ( true === WP_Http_Streams::test() && apply_filters('use_streams_transport', true) ) {
+			} else if ( true === WP_Http_Streams::test($args) ) {
 				$working_transport['streams'] = new WP_Http_Streams();
 				$blocking_transport[] = &$working_transport['streams'];
-			} else if ( true === WP_Http_Fsockopen::test() && apply_filters('use_fsockopen_transport', true) && ( isset($args['ssl']) && !$args['ssl'] ) ) {
+			} else if ( true === WP_Http_Fsockopen::test($args) ) {
 				$working_transport['fsockopen'] = new WP_Http_Fsockopen();
 				$blocking_transport[] = &$working_transport['fsockopen'];
 			}
@@ -382,6 +382,12 @@
 		else
 			$r['ssl'] = false;
 
+		// Determine if this request is to OUR install of WordPress
+		if ( stristr(get_bloginfo('url'), $arrURL['host']) )
+			$r['local'] = true;
+		else 
+			$r['local'] = false;
+
 		if ( is_null( $r['headers'] ) )
 			$r['headers'] = array();
 
@@ -793,12 +799,14 @@
 	 * @static
 	 * @return boolean False means this class can not be used, true means it can.
 	 */
-	function test() {
-		if ( false !== ($option = get_option( 'disable_fsockopen' )) && time()-$option < 43200 ) // 12 hours
+	function test($args = array()) {
+		if ( false !== ($option = get_option( 'disable_fsockopen' )) && time()-$option < 43200 && true != apply_filters('use_fsockopen_transport', true) ) // 12 hours
 			return false;
 
-		if ( function_exists( 'fsockopen' ) )
-			return true;
+		if ( function_exists( 'fsockopen' ) ) {
+			if ( isset($args['ssl']) && !$args['ssl'] )
+	                        return true;
+		}
 
 		return false;
 	}
@@ -906,11 +914,18 @@
 	 * @static
 	 * @return boolean False means this class can not be used, true means it can.
 	 */
-	function test() {
-		if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) )
-			return false;
+	function test($args = array()) {
+		if ( function_exists('fopen') && (function_exists('ini_get') && true == ini_get('allow_url_fopen')) && true == apply_filters('use_fopen_transport', true) ) {
+			if ( 
+				( isset($args['ssl']) && !$args['ssl'] ) || 
+				( isset($args['local']) && $args['local'] == true && apply_filters('https_local_ssl_verify', true) != true ) || 
+				( isset($args['local']) && $args['local'] == false && apply_filters('https_ssl_verify', true) != true ) || 
+				( isset($args['sslverify']) && !$args['sslverify'] ) 
+			) 
+	                        return true;
+		}
 
-		return true;
+		return false;		
 	}
 }
 
@@ -1041,8 +1056,8 @@
 	 *
 	 * @return boolean False means this class can not be used, true means it can.
 	 */
-	function test() {
-		if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) )
+	function test($args = array()) {
+		if ( ! function_exists('fopen') && (function_exists('ini_get') && true != ini_get('allow_url_fopen')) && true != apply_filters('use_streams_transport', true) )
 			return false;
 
 		if ( version_compare(PHP_VERSION, '5.0', '<') )
@@ -1166,8 +1181,8 @@
 	 *
 	 * @return boolean False means this class can not be used, true means it can.
 	 */
-	function test() {
-		if ( function_exists('http_request') )
+	function test($args = array()) {
+		if ( function_exists('http_request') && true == apply_filters('use_http_extension_transport', true) )
 			return true;
 
 		return false;
@@ -1318,8 +1333,8 @@
 	 *
 	 * @return boolean False means this class can not be used, true means it can.
 	 */
-	function test() {
-		if ( function_exists('curl_init') && function_exists('curl_exec') )
+	function test($args = array()) {
+		if ( function_exists('curl_init') && function_exists('curl_exec') && true == apply_filters('use_curl_transport', true) )
 			return true;
 
 		return false;
