Revert "Disabled implicit SSL support for update servers"
authorAlexander Ebert <ebert@woltlab.com>
Fri, 6 Feb 2015 11:47:00 +0000 (12:47 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 6 Feb 2015 11:47:00 +0000 (12:47 +0100)
This reverts commit a99a7150e4637698bcc9b8e699b041ad8fe1ca46.

wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php
wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php

index aa1bcd38e2a2e705d5385e32669313c5dde7c62c..024b7c37082bd002cb2aac6815faa51155fde401 100644 (file)
@@ -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);
        }
        
        /**
index 75ebc62e780753bfccc44b097aebfb66f9f1451a..6fa770eb22129d59b94afd75911a2dba55fc2f7e 100644 (file)
@@ -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);