how to fix "http error 0 trying to get http..../projects/... while updating

by jan   Last Updated September 15, 2017 02:07 AM

While trying to update modules the download fails and the following error is displayed (i've translated the string) "HTTP fejl 0 trying to fetch https://ftp.drupal.org/files/projects/.... it's not for a specific project/module but all that needs to be updated. The error occurs to some sites on a shared host - but not all of the sites. In the log there's a different error (i've translated the string) "Error occurred when trying to check https://ftp.drupal.org/files/translations/7.x/...: Error opening of socket ssl://ftp.drupal.org:443.

How can I fix this issue?



Answers 1


  • Fix function drupal_http_request
--- ./includes/common.inc       2017-06-21 15:20:18.000000000 -0300
+++ /var/www/drupal-7/includes/common.inc       2017-09-14 22:20:02.254394637 -0300
@@ -823,7 +823,7 @@
     'data' => NULL,
     'max_redirects' => 3,
     'timeout' => 30.0,
-    'context' => NULL,
+    'context' => stream_context_create(array('ssl'=>array('capath'=> ini_get('openssl.capath'),))),
   );

   // Merge the default headers.
  • Configure /etc/php/7.0/apache2/php.ini
openssl.capath=/etc/ssl/certs/
  • Install CA certificates
# apt-get install ca-certificates
Reinaldo Gil
Reinaldo Gil
September 15, 2017 01:37 AM

Related Questions


Keep node/user tabs in one language

Updated May 16, 2016 08:03 AM

How do I include a custom module translation?

Updated June 28, 2016 08:03 AM

Adding an existing node as a translation

Updated August 09, 2016 08:03 AM

Drupal 8: make Taxonomy terms translatable

Updated August 16, 2016 08:04 AM

How to show 404 page for nodes without translation?

Updated September 01, 2016 08:04 AM