WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 21 months ago

Last modified 11 months ago

#42186 closed enhancement (fixed)

Ability to pass hostname/url to https_ssl_verify filter

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

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 3 years ago.
Added context for the filters
42186.2.diff (3.0 KB) - added by audrasjb 21 months ago.
Update @since to 5.0.3

Download all attachments as: .zip

Change History (16)

#1 @dd32
3 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
3 years ago

Added context for the filters

#2 @purnendu
3 years ago

  • Keywords has-patch added; needs-patch removed

#3 @DrewAPicture
3 years ago

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

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

#4 @johnbillion
3 years ago

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

#5 @johnbillion
3 years 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

#6 @johnbillion
2 years ago

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

@since needs updating

#7 @pento
22 months ago

  • Milestone changed from 5.0.1 to 5.0.2

#8 @pento
22 months ago

  • Milestone changed from 5.0.2 to 5.0.3

@audrasjb
21 months ago

Update @since to 5.0.3

#9 @audrasjb
21 months ago

  • Keywords commit added

Hi,

42186.2.diff contains a refresh of @since

#10 @desrosj
21 months ago

  • Milestone changed from 5.0.3 to 5.1

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

#11 @desrosj
21 months ago

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

In 44397:

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

Introduced in [42682].

Fixes #42186.

#12 @desrosj
21 months ago

  • Keywords commit removed

#13 @pratikkry
21 months ago

  • Keywords needs-patch removed

#14 @SergeyBiryukov
11 months 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.

Note: See TracTickets for help on using tickets.