Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Move ClientTLSOptionsFactory init out of refresh_certificates #4611

Merged
merged 3 commits into from
Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/4611.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Move ClientTLSOptionsFactory init out of refresh_certificates
3 changes: 0 additions & 3 deletions synapse/app/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@ def refresh_certificate(hs):
logging.info("Loading certificate from disk...")
hs.config.read_certificate_from_disk()
hs.tls_server_context_factory = context_factory.ServerContextFactory(hs.config)
hs.tls_client_options_factory = context_factory.ClientTLSOptionsFactory(
hs.config
)
logging.info("Certificate loaded.")

if hs._listening_services:
Expand Down
5 changes: 4 additions & 1 deletion synapse/http/matrixfederationclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
RequestSendFailed,
SynapseError,
)
from synapse.crypto import context_factory
from synapse.http.federation.matrix_federation_agent import MatrixFederationAgent
from synapse.util.async_helpers import timeout_deferred
from synapse.util.logcontext import make_deferred_yieldable
Expand Down Expand Up @@ -174,9 +175,11 @@ def __init__(self, hs):
self.server_name = hs.hostname
reactor = hs.get_reactor()

tls_client_options_factory = context_factory.ClientTLSOptionsFactory(hs.config)

self.agent = MatrixFederationAgent(
hs.get_reactor(),
hs.tls_client_options_factory,
tls_client_options_factory,
)
self.clock = hs.get_clock()
self._store = hs.get_datastore()
Expand Down