mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
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:
@@ -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 ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user