From a8e8a9dfb968d7e93b01404b9a12c1e48d8431a4 Mon Sep 17 00:00:00 2001
From: Lukas Reschke <lukas@owncloud.com>
Date: Tue, 8 Sep 2015 12:09:11 +0200
Subject: [PATCH] Move certificate bundle into resources/config/

---
 lib/private/http/client/client.php          | 2 +-
 lib/private/security/certificatemanager.php | 2 +-
 lib/private/updater.php                     | 7 -------
 {config => resources/config}/ca-bundle.crt  | 0
 4 files changed, 2 insertions(+), 9 deletions(-)
 rename {config => resources/config}/ca-bundle.crt (100%)

diff --git a/lib/private/http/client/client.php b/lib/private/http/client/client.php
index b0aff10a413..1907937e55e 100644
--- a/lib/private/http/client/client.php
+++ b/lib/private/http/client/client.php
@@ -62,7 +62,7 @@ class Client implements IClient {
 			$dataDir = $this->config->getSystemValue('datadirectory');
 			$this->client->setDefaultOption('verify', $dataDir.'/'.$this->certificateManager->getCertificateBundle());
 		} else {
-			$this->client->setDefaultOption('verify', \OC::$SERVERROOT . '/config/ca-bundle.crt');
+			$this->client->setDefaultOption('verify', \OC::$SERVERROOT . '/resources/config/ca-bundle.crt');
 		}
 
 		$this->client->setDefaultOption('headers/User-Agent', 'ownCloud Server Crawler');
diff --git a/lib/private/security/certificatemanager.php b/lib/private/security/certificatemanager.php
index 4d470f69a66..ded81863a73 100644
--- a/lib/private/security/certificatemanager.php
+++ b/lib/private/security/certificatemanager.php
@@ -110,7 +110,7 @@ class CertificateManager implements ICertificateManager {
 		}
 
 		// Append the default certificates
-		$defaultCertificates = file_get_contents(\OC::$SERVERROOT . '/config/ca-bundle.crt');
+		$defaultCertificates = file_get_contents(\OC::$SERVERROOT . '/resources/config/ca-bundle.crt');
 		fwrite($fh_certs, $defaultCertificates);
 		fclose($fh_certs);
 	}
diff --git a/lib/private/updater.php b/lib/private/updater.php
index 71e9732c307..b33180c3425 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -279,13 +279,6 @@ class Updater extends BasicEmitter {
 			throw new \Exception($e->getMessage());
 		}
 
-		// FIXME: Some users do not upload the new ca-bundle.crt, let's catch this
-		// in the update. For a newer release we shall use an integrity check after
-		// the update.
-		if(!file_exists(\OC::$configDir .'/ca-bundle.crt')) {
-			throw new \Exception('Please upload the ca-bundle.crt file into the \'config\' directory.');
-		}
-
 		// create empty file in data dir, so we can later find
 		// out that this is indeed an ownCloud data directory
 		// (in case it didn't exist before)
diff --git a/config/ca-bundle.crt b/resources/config/ca-bundle.crt
similarity index 100%
rename from config/ca-bundle.crt
rename to resources/config/ca-bundle.crt
-- 
GitLab