Make WordPress Core

Opened 9 years ago

Closed 8 years ago

Last modified 3 months ago

#42186 closed enhancement (fixed)

Ability to pass hostname/url to https_ssl_verify filter

Reported by: paulschreiber Owned by: johnbillion
Priority: normal Milestone: 5.1
Component: HTTP API Version: 4.9
Severity: normal Keywords:
Cc: Focuses:

Description

It would be very useful to be able to pass the hostname (or full URL) to the https_ssl_verify filter.

This would allow me to disable verification for requests to my local development machine (i.e.

wp_remote_get( 'http://vip.local' );

), but keep it enabled for other hosts.

Attachments (2)

42186.diff​ (4.9 KB ) - added by purnendu 9 years ago.
Added context for the filters
42186.2.diff​ (3.0 KB ) - added by audrasjb 8 years ago.
Update @since to 5.0.3

Download all attachments as: .zip

Change History (17)

#1 @dd32
9 years ago

  • Keywords needs-patch good-first-bug added

Passing some context to the http_* filters seems like a good request.

For reference, here's the current HTTP filters, roughly divided into those with context, and those without. Not all of these will need context, such as block_local_requests:

apply_filters( 'http_request_args', $r, $url )
apply_filters( 'pre_http_request', false, $r, $url )
apply_filters( 'http_response', $response, $r, $url )
apply_filters( 'http_api_transports', $transports, $args, $url )
apply_filters( 'http_response', $response, $args, $url )

apply_filters( 'http_request_timeout', 5 )
apply_filters( 'http_request_redirection_count', 5 )
apply_filters( 'http_request_version', '1.0' )
apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) )
apply_filters( 'http_request_reject_unsafe_urls', false )
apply_filters( 'https_ssl_verify', $options['verify'] )
apply_filters( 'block_local_requests', false )

@purnendu
9 years ago

Added context for the filters

#2 @purnendu
9 years ago

  • Keywords has-patch added; needs-patch removed

#3 @DrewAPicture
9 years ago

  • Owner set to purnendu
  • Status new → assigned

Assigning to mark the good-first-bug as "claimed".

#4 @johnbillion
9 years ago

  • Milestone Awaiting Review → 5.0
  • Owner changed from purnendu to johnbillion
  • Status assigned → reviewing

#5 @johnbillion
9 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 42682:

HTTP API: Add the URL as a paramter to various HTTP related filters.

Props paulschreiber, purnendu

Fixes #42186

#6 @johnbillion
8 years ago

  • Keywords needs-patch added; good-first-bug has-patch removed
  • Milestone 5.0 → 5.0.1
  • Resolution fixed
  • Status closed → reopened

@since needs updating

#7 @pento
8 years ago

  • Milestone 5.0.1 → 5.0.2

#8 @pento
8 years ago

  • Milestone 5.0.2 → 5.0.3

@audrasjb
8 years ago

Update @since to 5.0.3

#9 @audrasjb
8 years ago

  • Keywords commit added

Hi,

42186.2.diff contains a refresh of @since

#10 @desrosj
8 years ago

  • Milestone 5.0.3 → 5.1

Let's leave this in 5.1. The since tags just need to be changed.

#11 @desrosj
8 years ago

  • Resolution → fixed
  • Status reopened → closed

In 44397:

Docs: Update since annotation for new $url parameter for several HTTP related filters.

Introduced in [42682].

Fixes #42186.

#12 @desrosj
8 years ago

  • Keywords commit removed

#13 @pratikkry
8 years ago

  • Keywords needs-patch removed

#14 @SergeyBiryukov
7 years ago

In 46750:

XML-RPC: Pass correct variable as the URL parameter to http_headers_useragent filter in wp_xmlrpc_server::pingback_ping().

Props wpgurudev, andreaitm.
Fixes #48721. See #42186.

#15 @westonruter
3 months ago

In 62894:

HTTP API: Pass the missing URL to the https_local_ssl_verify filter.

The filter has documented a $url parameter since 5.1.0, when r42682 added it to the transports in WP_Http_Streams and WP_Http_Curl. However, this new parameter was not passed to all instances of the filter being applied, resulting in a possible fatal error if a callback is expecting it.

These call sites were surfaced by the PHPStan extensions under development for this ticket, which are committed separately.

Developed as subset of ​https://github.com/WordPress/wordpress-develop/pull/12022.
Follow-up to r28781, r42682, r46230, r46231, r54043, r58128.

See #65376, #42186, #47957, #56041, #58281.

Note: See TracTickets for help on using tickets.