WP_HTTP: Replacing the Fsockopen & Streams Transports with a new Streams transport which fully supports HTTPS communication.

This changeset also bundles ca-bundle.crt from the Mozilla project to allow for us to verify SSL certificates on hosts which have an incomplete, outdated, or invalid local SSL configuration.
Props rmccue for major assistance getting this this far. See #25007 for discussion, also Fixes #16606 


git-svn-id: https://develop.svn.wordpress.org/trunk@25224 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2013-09-04 04:48:21 +00:00
parent d8e8eada52
commit 5d57f260ed
4 changed files with 3751 additions and 271 deletions
+16
View File
@@ -270,4 +270,20 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
$res = wp_remote_get( $url );
$this->assertEquals( 'PASS', wp_remote_retrieve_body( $res ) );
}
/**
* Test if HTTPS support works
*
* @group ssl
* @ticket 25007
*/
function test_ssl() {
if ( ! wp_http_supports( array( 'ssl' ) ) )
$this->markTestSkipped( 'This install of PHP does not support SSL' );
$res = wp_remote_get( 'https://wordpress.org/' );
$this->assertTrue( ! is_wp_error( $res ), print_r( $res, true ) );
}
}
-20
View File
@@ -1,20 +0,0 @@
<?php
require_once dirname( __FILE__ ) . '/base.php';
/**
* @group http
* @group external-http
*/
class Tests_HTTP_fsockopen extends WP_HTTP_UnitTestCase {
var $transport = 'fsockopen';
function setUp() {
add_filter( 'pre_option_disable_fsockopen', '__return_null' );
parent::setUp();
}
function tearDown() {
remove_filter( 'pre_option_disable_fsockopen', '__return_null' );
parent::tearDown();
}
}