When I try to check for updates I get this error:

GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to updates.drupal.org port 80: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in GuzzleHttp\Handler\CurlFactory::createRejection() (line 186 of /data/www/drupal8/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php).

drush up from the command line works fine for me.

I had to add our proxy name proxy=http://dmzproxy:3128 to ~/.curlrc, to make curl updates.drupal.org work.

Comments

raj45 created an issue. See original summary.

raj45’s picture

dawehner’s picture

You probably have to put something like this into your settings.php:
$settings['http_client_config']['proxy'] = 'http://dmzproxy:3128'

raj45’s picture

Thanks for your suggestion @dawehner. Adding the below seems to fix it:

$settings['http_client_config']['proxy']['http'] = 'dmzproxy:3128';
$settings['http_client_config']['proxy']['https'] = 'dmzproxy:3128';
$settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost'];

There are also some proxy setting included in settings.php, which doesn't seem to do any difference... perhaps it should be updated or removed? Or are they serving another purpose?

/**
 * External access proxy settings:
 *
 * If your site must access the Internet via a web proxy then you can enter
 * the proxy settings here. Currently only basic authentication is supported
 * by using the username and password variables. The proxy_user_agent variable
 * can be set to NULL for proxies that require no User-Agent header or to a
 * non-empty string for proxies that limit requests to a specific agent. The
 * proxy_exceptions variable is an array of host names to be accessed directly,
 * not via proxy.
 */
# $settings['proxy_server'] = '';
# $settings['proxy_port'] = 8080;
# $settings['proxy_username'] = '';
# $settings['proxy_password'] = '';
# $settings['proxy_user_agent'] = '';
# $settings['proxy_exceptions'] = array('127.0.0.1', 'localhost');
raj45’s picture

It seems like I need to have all these defined for it to work...

# proxy settings
$settings['http_client_config']['proxy']['http'] = 'dmzproxy.proxydomain-example.com:3128';
$settings['http_client_config']['proxy']['https'] = 'dmzproxy.proxydomain-example.com:3128';
$settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost', 'www.example.com', '127.16.0.0/12', '127.16.*', '127.17.*'];

$settings['proxy_server'] = 'dmzproxy.proxydomain-example.com';
$settings['proxy_port'] = 3128;
$settings['proxy_username'] = '';
$settings['proxy_password'] = '';
$settings['proxy_user_agent'] = '';
$settings['proxy_exceptions'] = array('www.example.com', '127.16.0.0/12', '127.16.*', '127.17.*', 'localhost');
cilefen’s picture

Status: Active » Closed (works as designed)