Changeset 34639
- Timestamp:
- 09/27/2015 09:37:00 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-http-curl.php
r34585 r34639 134 134 curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, ( $ssl_verify === true ) ? 2 : false ); 135 135 curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify ); 136 curl_setopt( $handle, CURLOPT_CAINFO, $r['sslcertificates'] ); 136 137 if ( $ssl_verify ) { 138 curl_setopt( $handle, CURLOPT_CAINFO, $r['sslcertificates'] ); 139 } 140 137 141 curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] ); 138 142 -
trunk/tests/phpunit/tests/http/base.php
r34600 r34639 16 16 var $fileStreamUrl = 'http://s.w.org/screenshots/3.9/dashboard.png'; 17 17 18 protected $http_request_args; 19 18 20 function setUp() { 19 21 … … 41 43 } 42 44 parent::tearDown(); 45 } 46 47 function filter_http_request_args( array $args ) { 48 $this->http_request_args = $args; 49 return $args; 43 50 } 44 51 … … 284 291 285 292 /** 293 * Test HTTP requests where SSL verification is disabled but the CA bundle is still populated 294 * 295 * @ticket 33978 296 */ 297 function test_https_url_without_ssl_verification() { 298 $url = 'https://wordpress.org/'; 299 $args = array( 300 'sslverify' => false, 301 ); 302 303 add_filter( 'http_request_args', array( $this, 'filter_http_request_args' ) ); 304 305 $res = wp_remote_head( $url, $args ); 306 307 remove_filter( 'http_request_args', array( $this, 'filter_http_request_args' ) ); 308 309 $this->assertNotEmpty( $this->http_request_args['sslcertificates'] ); 310 $this->assertNotWPError( $res ); 311 } 312 313 /** 286 314 * Test HTTP Redirects with multiple Location headers specified 287 315 *
Note: See TracChangeset
for help on using the changeset viewer.