Make WordPress Core

Opened 5 months ago

Closed 5 weeks ago

#42186 closed enhancement (fixed)

Ability to pass hostname/url to https_ssl_verify filter

Reported by: paulschreiber Owned by: johnbillion
Milestone: 5.0 Priority: normal
Severity: normal Version: 4.9
Component: HTTP API Keywords: good-first-bug has-patch
Focuses: Cc:


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 (1)

42186.diff (4.9 KB) - added by purnendu 5 months ago.
Added context for the filters

Download all attachments as: .zip

Change History (6)

#1 @dd32
5 months 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 )

5 months ago

Added context for the filters

#2 @purnendu
5 months ago

  • Keywords has-patch added; needs-patch removed

#3 @DrewAPicture
6 weeks ago

  • Owner set to purnendu
  • Status changed from new to assigned

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

#4 @johnbillion
5 weeks ago

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

#5 @johnbillion
5 weeks ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 42682:

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

Props paulschreiber, purnendu

Fixes #42186

Note: See TracTickets for help on using tickets.