The current code in 'function drupal_http_request' don't use CONNECT method to make a proxy request. This method permit that php validade the server certificate and not delegate to proxy.

The code uses GET to request to proxy a https URI with 'tcp://' scheme. This require that certificates must be updated on proxy, what some times is not possible. When proxy can't validate connection certificate drupal thrwo 'HTTP error 500 occurred when trying to fetch' and 'Unable to retrieve Drupal project from'.

Some work is need in lines 864 to 890 of file includes/common.inc to use 'stream_context_create' to setup proxy for 'ssl://' scheme like suggested https://stackoverflow.com/questions/11607731/stream-socket-client-via-ht...

$options['context'] = stream_context_create(array( 'http' => array( 'proxy' => 'tcp://127.0.0.1:8888', ) ) );

I dont have expertise to to this. Opening this issue to register and help people with proxy problems.

Comments

reinaldoc created an issue. See original summary.

reinaldoc’s picture

Issue summary: View changes
reinaldoc’s picture

Issue summary: View changes
reinaldoc’s picture

Version: 7.56 » 7.x-dev

update version to 7.x

cilefen’s picture

Status: Needs work » Active

For anyone working on this, please be aware of the backport policy.