-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check new version fails #1335
Comments
|
I've been able to reproduce the error; but it seems to work now. I wonder if that was a GitHub issue. Could you please test again? |
Nope, it's still failing
Sorry... |
see #656 |
@simonpanay seems to be related to a proxy issue; are you also behind a proxy? |
see also #693 |
The check update used to work behind a proxy in GLPI 0.90.1 and I think 0.90.2 but stopped working in 0.90.3 onwards. It still works when not using a proxy. |
Could you try with the following changes (I do not have a proxy to test): diff --git a/inc/toolbox.class.php b/inc/toolbox.class.php
index f0a0104..0f692f1 100644
--- a/inc/toolbox.class.php
+++ b/inc/toolbox.class.php
@@ -1631,16 +1631,18 @@ class Toolbox {
$content = "";
$taburl = parse_url($url);
+ $hostscheme = '';
+ $defaultport = 80;
+
+ // Manage standard HTTPS port : scheme detection or port 443
+ if ((isset($taburl["scheme"]) && $taburl["scheme"]=='https')
+ || (isset($taburl["port"]) && $taburl["port"]=='443')) {
+ $hostscheme = 'ssl://';
+ $defaultport = 443;
+ }
+
// Connection directe
if (empty($CFG_GLPI["proxy_name"])) {
- $hostscheme = '';
- $defaultport = 80;
- // Manage standard HTTPS port : scheme detection or port 443
- if ((isset($taburl["scheme"]) && $taburl["scheme"]=='https')
- || (isset($taburl["port"]) && $taburl["port"]=='443')) {
- $hostscheme = 'ssl://';
- $defaultport = 443;
- }
if ($fp = @fsockopen($hostscheme.$taburl["host"],
(isset($taburl["port"]) ? $taburl["port"] : $defaultport),
$errno, $errstr, 1)) {
@@ -1671,7 +1673,7 @@ class Toolbox {
if ($fp) {
$request = "GET $url HTTP/1.1\r\n";
- $request .= "Host: ".$taburl["host"]."\r\n";
+ $request .= "Host: ".$taburl["host"].":".(isset($taburl["port"]) ? $taburl["port"] : $defaultport)."\r\n";
if (!empty($CFG_GLPI["proxy_user"])) {
$request .= "Proxy-Authorization: Basic " . base64_encode ($CFG_GLPI["proxy_user"].":".
self::decrypt($CFG_GLPI["proxy_passwd"], GLPIKEY)) . "\r\n"; |
@trasher just tested your change on GLPI 0.90.5 and unfortunately the same error message is occurs. |
Please see solution provided in #1660 |
@simonpanay thank you. I'm waiting for a positive report to include this fix in the next GLPI release coming monday ;) |
And our proxy doesn't require authentication. Sorry |
@simonpanay well, at least, that will work with proxies that does not requires authentication... ;) Thanks for the feedback. |
@trasher Indeed. Thanks for the bug fix ;o) |
GLPI fails to check if a new version is available
GLPI 9.1.1 (with plugin FusionInventory)
Debian 8
Step to reproduce :
A message appears :
Erreur
Connexion au site impossible (HTTP/1.1 501 Not Implemented)
php_error.log :
The text was updated successfully, but these errors were encountered: