Index: cron.php
===================================================================
--- cron.php	(revision 8044)
+++ cron.php	(working copy)
@@ -71,6 +71,13 @@
 	return false;
 }
 
+/**
+ * Send request to run cron through HTTP request that doesn't halt page loading.
+ *
+ * @since 2.1.0
+ *
+ * @return null CRON could not be spawned, because it is not needed to run.
+ */
 function spawn_cron() {
 	$crons = _get_cron_array();
 
@@ -81,27 +88,9 @@
 	if ( array_shift( $keys ) > time() )
 		return;
 
-	$cron_url = get_option( 'siteurl' ) . '/wp-cron.php';
-	$parts = parse_url( $cron_url );
+	$cron_url = get_option( 'siteurl' ) . '/wp-cron.php?check=' . wp_hash('187425');
 
-	if ($parts['scheme'] == 'https') {
-		// support for SSL was added in 4.3.0
-		if (version_compare(phpversion(), '4.3.0', '>=') && function_exists('openssl_open')) {
-			$port = isset($parts['port']) ? $parts['port'] : 443;
-			$argyle = @fsockopen('ssl://' . $parts['host'], $port, $errno, $errstr, 0.01);
-		} else {
-			return false;
-		}
-	} else {
-		$port = isset($parts['port']) ? $parts['port'] : 80;
-		$argyle = @ fsockopen( $parts['host'], $port, $errno, $errstr, 0.01 );
-	}
-
-	if ( $argyle )
-		fputs( $argyle,
-			  "GET {$parts['path']}?check=" . wp_hash('187425') . " HTTP/1.0\r\n"
-			. "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n"
-		);
+	wp_remote_post($cron_url, array('timeout' => 0.01));
 }
 
 function wp_cron() {
Index: update.php
===================================================================
--- update.php	(revision 8044)
+++ update.php	(working copy)
@@ -7,10 +7,11 @@
  */
 
 /**
- * wp_version_check() - Check WordPress version against the newest version.
+ * Check WordPress version against the newest version.
  *
- * The WordPress version, PHP version, and Locale is sent. Checks against the WordPress server at
- * api.wordpress.org server. Will only check if PHP has fsockopen enabled and WordPress isn't installing.
+ * The WordPress version, PHP version, and Locale is sent. Checks against the
+ * WordPress server at api.wordpress.org server. Will only check if WordPress
+ * isn't installing.
  *
  * @package WordPress
  * @since 2.3
@@ -19,7 +20,7 @@
  * @return mixed Returns null if update is unsupported. Returns false if check is too soon.
  */
 function wp_version_check() {
-	if ( !function_exists('fsockopen') || strpos($_SERVER['PHP_SELF'], 'install.php') !== false || defined('WP_INSTALLING') )
+	if ( strpos($_SERVER['PHP_SELF'], 'install.php') !== false || defined('WP_INSTALLING') )
 		return;
 
 	global $wp_version;
@@ -39,34 +40,32 @@
 	$new_option->last_checked = time(); // this gets set whether we get a response or not, so if something is down or misconfigured it won't delay the page load for more than 3 seconds, twice a day
 	$new_option->version_checked = $wp_version;
 
-	$http_request  = "GET /core/version-check/1.1/?version=$wp_version&php=$php_version&locale=$locale HTTP/1.0\r\n";
-	$http_request .= "Host: api.wordpress.org\r\n";
-	$http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . get_option('blog_charset') . "\r\n";
-	$http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n";
-	$http_request .= "\r\n";
+	$url = "http://api.wordpress.org/core/version-check/1.1/?version=$wp_version&php=$php_version&locale=$locale";
+	$options = array('timeout' => 3);
 
-	$response = '';
-	if ( false !== ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3 ) ) && is_resource($fs) ) {
-		fwrite( $fs, $http_request );
-		while ( !feof( $fs ) )
-			$response .= fgets( $fs, 1160 ); // One TCP-IP packet
-		fclose( $fs );
+	$headers = array(
+		'Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'),
+		'User-Agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url')
+	);
 
-		$response = explode("\r\n\r\n", $response, 2);
-		if ( !preg_match( '|HTTP/.*? 200|', $response[0] ) )
-			return false;
+	$response = wp_remote_request($url, $options, $headers);
 
-		$body = trim( $response[1] );
-		$body = str_replace(array("\r\n", "\r"), "\n", $body);
+	if( 200 != $response['response']['code'] )
+		return false;
 
-		$returns = explode("\n", $body);
+	$body = $response['body'];
 
-		$new_option->response = attribute_escape( $returns[0] );
-		if ( isset( $returns[1] ) )
-			$new_option->url = clean_url( $returns[1] );
-		if ( isset( $returns[2] ) )
-			$new_option->current = attribute_escape( $returns[2] );
-	}
+	$body = trim( $response[1] );
+	$body = str_replace(array("\r\n", "\r"), "\n", $body);
+
+	$returns = explode("\n", $body);
+
+	$new_option->response = attribute_escape( $returns[0] );
+	if ( isset( $returns[1] ) )
+		$new_option->url = clean_url( $returns[1] );
+	if ( isset( $returns[2] ) )
+		$new_option->current = attribute_escape( $returns[2] );
+
 	update_option( 'update_core', $new_option );
 }
 

