summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-03-11 13:32:59 +0000
committerErik Johnston <erik@matrix.org>2016-03-11 13:32:59 +0000
commitd5fda6e3b03a01449dc17e2f8520b0605ae2b625 (patch)
tree8b91314bffde765043da5aedee0d68b4523f312c
parentMerge pull request #635 from matrix-org/erikj/sync_order (diff)
parentMake key client send a Host header (diff)
downloadsynapse-d5fda6e3b03a01449dc17e2f8520b0605ae2b625.tar.xz
Merge pull request #640 from matrix-org/erikj/keyclient_host
Make key client send a Host header
-rw-r--r--synapse/crypto/keyclient.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/crypto/keyclient.py b/synapse/crypto/keyclient.py
index 784d02f122..54b83da9d8 100644
--- a/synapse/crypto/keyclient.py
+++ b/synapse/crypto/keyclient.py
@@ -36,6 +36,7 @@ def fetch_server_key(server_name, ssl_context_factory, path=KEY_API_V1):
 
     factory = SynapseKeyClientFactory()
     factory.path = path
+    factory.host = server_name
     endpoint = matrix_federation_endpoint(
         reactor, server_name, ssl_context_factory, timeout=30
     )
@@ -81,6 +82,8 @@ class SynapseKeyClientProtocol(HTTPClient):
         self.host = self.transport.getHost()
         logger.debug("Connected to %s", self.host)
         self.sendCommand(b"GET", self.path)
+        if self.host:
+            self.sendHeader(b"Host", self.host)
         self.endHeaders()
         self.timer = reactor.callLater(
             self.timeout,