Not sure if this helps, but you can try..
So WordPress’ default HTTP transport is using cURL, and the HTTP class sets the proxy authorization method to CURLAUTH_ANY
(see source), which might explain why the Proxy-Authorization: Basic xxxxx...
header is missing from the request.
And there’s a hook you can try to change the proxy authorization method to CURLAUTH_BASIC
(which is widely supported, but also very insecure), CURLAUTH_NTLM
or one of the other available methods.
So add this to your theme functions.php
file.. (or put the code into a Must-Use plugin):
add_action( 'http_api_curl', function ( $handle, $r, $url ) {
$proxy = new WP_HTTP_Proxy();
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_BASIC );
}
}, 10, 3 );
Alternatively, you can set PHP Streams as the default HTTP transport…
add_filter( 'http_api_transports', function ( $transports ) {
return [ 'streams', 'curl' ];
} );
See the hook’s reference and WP_Http_Streams
for more information. But basically, the hook allows you to use a custom class, and WP_Http_Streams
would always set the Proxy-Authorization: Basic xxxxx...
header when necessary.