Make WordPress Core

Opened 2 months ago

Last modified 7 weeks ago

#42186 new enhancement

Ability to pass hostname/url to https_ssl_verify filter

Reported by: paulschreiber Owned by:
Milestone: Awaiting Review 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 7 weeks ago.
Added context for the filters

Download all attachments as: .zip

Change History (3)

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

7 weeks ago

Added context for the filters

#2 @purnendu
7 weeks ago

  • Keywords has-patch added; needs-patch removed
Note: See TracTickets for help on using tickets.