From: Alexander Ebert Date: Fri, 6 Feb 2015 11:47:00 +0000 (+0100) Subject: Revert "Disabled implicit SSL support for update servers" X-Git-Tag: 2.1.0_RC_1~76 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b6bb441a7fa7ab8630b5d42055226ed8aeb2a531;p=GitHub%2FWoltLab%2FWCF.git Revert "Disabled implicit SSL support for update servers" This reverts commit a99a7150e4637698bcc9b8e699b041ad8fe1ca46. --- diff --git a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php index aa1bcd38e2..024b7c3708 100644 --- a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php +++ b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php @@ -173,12 +173,11 @@ class PackageUpdateServer extends DatabaseObject { $serverURL = FileUtil::addTrailingSlash($this->serverURL) . 'list/' . WCF::getLanguage()->getFixedLanguageCode() . '.xml'; $metaData = $this->getMetaData(); - //if (!RemoteFile::supportsSSL() || !$metaData['ssl']) { - if (!RemoteFile::supportsSSL()) { + if (!RemoteFile::supportsSSL() || !$metaData['ssl']) { return preg_replace('~^https://~', 'http://', $serverURL); } - return $serverURL; + return preg_replace('~^http://~', 'https://', $serverURL); } /** @@ -192,12 +191,11 @@ class PackageUpdateServer extends DatabaseObject { } $metaData = $this->getMetaData(); - //if (!RemoteFile::supportsSSL() || !$metaData['ssl']) { - if (!RemoteFile::supportsSSL()) { + if (!RemoteFile::supportsSSL() || !$metaData['ssl']) { return preg_replace('~^https://~', 'http://', $this->serverURL); } - return $this->serverURL; + return preg_replace('~^http://~', 'https://', $this->serverURL); } /** diff --git a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php index 75ebc62e78..6fa770eb22 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php @@ -134,16 +134,15 @@ class PackageUpdateDispatcher extends SingletonFactory { if (empty($reply['httpHeaders']['etag']) && empty($reply['httpHeaders']['last-modified'])) { throw new SystemException("Missing required HTTP headers 'etag' and 'last-modified'."); } - /*else if (empty($reply['httpHeaders']['wcf-update-server-ssl'])) { + else if (empty($reply['httpHeaders']['wcf-update-server-ssl'])) { throw new SystemException("Missing required HTTP header 'wcf-update-server-ssl'."); - }*/ + } $metaData['list'] = array(); if (!empty($reply['httpHeaders']['etag'])) $metaData['list']['etag'] = reset($reply['httpHeaders']['etag']); if (!empty($reply['httpHeaders']['last-modified'])) $metaData['list']['lastModified'] = reset($reply['httpHeaders']['last-modified']); - $metaData['ssl'] = false; - //(reset($reply['httpHeaders']['wcf-update-server-ssl']) == 'true') ? true : false; + $metaData['ssl'] = (reset($reply['httpHeaders']['wcf-update-server-ssl']) == 'true') ? true : false; } $data['metaData'] = serialize($metaData);