summary refs log tree commit diff
path: root/synapse/federation/federation_client.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@arasphere.net>2018-01-22 19:11:18 +0100
committerGitHub <noreply@github.com>2018-01-22 19:11:18 +0100
commitab9f844aaf3662a64dbc4c56077e9fa37bc7d5d0 (patch)
treedf5417cbd46f5c9a386d4d762f83b06d58afda17 /synapse/federation/federation_client.py
parentMerge pull request #2813 from matrix-org/matthew/registrations_require_3pid (diff)
downloadsynapse-ab9f844aaf3662a64dbc4c56077e9fa37bc7d5d0.tar.xz
Add federation_domain_whitelist option (#2820)
Add federation_domain_whitelist

gives a way to restrict which domains your HS is allowed to federate with.
useful mainly for gracefully preventing a private but internet-connected HS from trying to federate to the wider public Matrix network
Diffstat (limited to 'synapse/federation/federation_client.py')
-rw-r--r--synapse/federation/federation_client.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py
index b1fe03f702..813907f7f2 100644
--- a/synapse/federation/federation_client.py
+++ b/synapse/federation/federation_client.py
@@ -23,7 +23,7 @@ from twisted.internet import defer
 
 from synapse.api.constants import Membership
 from synapse.api.errors import (
-    CodeMessageException, HttpResponseException, SynapseError,
+    CodeMessageException, HttpResponseException, SynapseError, FederationDeniedError
 )
 from synapse.events import builder
 from synapse.federation.federation_base import (
@@ -266,6 +266,9 @@ class FederationClient(FederationBase):
             except NotRetryingDestination as e:
                 logger.info(e.message)
                 continue
+            except FederationDeniedError as e:
+                logger.info(e.message)
+                continue
             except Exception as e:
                 pdu_attempts[destination] = now