summaryrefslogtreecommitdiffstats
path: root/lib/private/Remote
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Remote')
-rw-r--r--lib/private/Remote/Instance.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/Remote/Instance.php b/lib/private/Remote/Instance.php
index 0ed301ae868..3e77226edad 100644
--- a/lib/private/Remote/Instance.php
+++ b/lib/private/Remote/Instance.php
@@ -97,19 +97,26 @@ class Instance implements IInstance {
/**
* @return array
* @throws NotFoundException
+ * @throws \Exception
*/
private function getStatus() {
if ($this->status) {
return $this->status;
}
$key = 'remote/' . $this->url . '/status';
+ $httpsKey = 'remote/' . $this->url . '/https';
$status = $this->cache->get($key);
if (!$status) {
$response = $this->downloadStatus('https://' . $this->getUrl() . '/status.php');
$protocol = 'https';
if (!$response) {
+ if ($status = $this->cache->get($httpsKey)) {
+ throw new \Exception('refusing to connect to remote instance(' . $this->url . ') over http that was previously accessible over https');
+ }
$response = $this->downloadStatus('http://' . $this->getUrl() . '/status.php');
$protocol = 'http';
+ } else {
+ $this->cache->set($httpsKey, true, 60 * 60 * 24 * 365);
}
$status = json_decode($response, true);
if ($status) {