From fde32485ecde922114f9151a20f821dc799ec7cb Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 6 Feb 2015 14:24:14 +0100 Subject: [PATCH] Use a lower timeout if attempting to fetch via SSL/TLS --- .../lib/system/package/PackageUpdateDispatcher.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php index 47fea1058e..52d5ab4626 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php @@ -97,10 +97,8 @@ class PackageUpdateDispatcher extends SingletonFactory { $authData = $updateServer->getAuthData(); if ($authData) $settings['auth'] = $authData; - // append auth code if set and update server resolves to woltlab.com - /*if (PACKAGE_SERVER_AUTH_CODE && Regex::compile('^https?://[a-z]+.woltlab.com/')->match($updateServer->serverURL)) { - $postData['authCode'] = PACKAGE_SERVER_AUTH_CODE; - }*/ + $secureConnection = $updateServer->attemptSecureConnection(); + if ($secureConnection && !$forceHTTP) $settings['timeout'] = 5; $request = new HTTPRequest($updateServer->getListURL($forceHTTP), $settings); @@ -122,7 +120,7 @@ class PackageUpdateDispatcher extends SingletonFactory { $statusCode = (is_array($reply['statusCode'])) ? reset($reply['statusCode']) : $reply['statusCode']; // status code 0 is a connection timeout - if (!$statusCode && $updateServer->attemptSecureConnection()) { + if (!$statusCode && $secureConnection) { if (preg_match('~https?://(?:update|store)\.woltlab\.com~', $updateServer->serverURL)) { // woltlab.com servers are most likely to be available, thus we assume that SSL connections are dropped RemoteFile::disableSSL(); -- 2.20.1