This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support using SSL on worker endpoints. #14128
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e8d52f2
Fix missing SSL support in worker endpoints.
ab45ab1
Add changelog
68af173
SSL for Replication endpoint
a43b3c0
Remove unit test change
fdf76aa
Merge branch 'develop' into tuojamie/ssl_workers
2d14b26
Refactor listener creation to reduce duplicated code
tojamies 2871546
Merge branch 'develop' into tuojamie/ssl_workers
ac5184f
Fix the logger message
6d6bce3
Update synapse/app/_base.py
415ee8c
Update synapse/app/_base.py
36aa70c
Update synapse/app/_base.py
fc35a13
Merge branch 'develop' into tuojamie/ssl_workers
1b7aadf
Merge branch 'develop' into tuojamie/ssl_workers
e805da7
Merge branch 'develop' into tuojamie/ssl_workers
4fda2d5
Add config documentation for new TLS option
reivilibre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add TLS support for generic worker endpoints. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -37,8 +37,7 @@ | |||||||||
from synapse.app import _base | ||||||||||
from synapse.app._base import ( | ||||||||||
handle_startup_exception, | ||||||||||
listen_ssl, | ||||||||||
listen_tcp, | ||||||||||
listen_http, | ||||||||||
max_request_body_size, | ||||||||||
redirect_stdio_to_logs, | ||||||||||
register_start, | ||||||||||
|
@@ -53,7 +52,6 @@ | |||||||||
RootOptionsRedirectResource, | ||||||||||
StaticResource, | ||||||||||
) | ||||||||||
from synapse.http.site import SynapseSite | ||||||||||
from synapse.logging.context import LoggingContext | ||||||||||
from synapse.metrics import METRICS_PREFIX, MetricsResource, RegistryProxy | ||||||||||
from synapse.replication.http import REPLICATION_PREFIX, ReplicationRestResource | ||||||||||
|
@@ -83,8 +81,6 @@ def _listener_http( | |||||||||
self, config: HomeServerConfig, listener_config: ListenerConfig | ||||||||||
) -> Iterable[Port]: | ||||||||||
port = listener_config.port | ||||||||||
bind_addresses = listener_config.bind_addresses | ||||||||||
tls = listener_config.tls | ||||||||||
# Must exist since this is an HTTP listener. | ||||||||||
assert listener_config.http_options is not None | ||||||||||
site_tag = listener_config.http_options.tag | ||||||||||
|
@@ -140,37 +136,15 @@ def _listener_http( | |||||||||
else: | ||||||||||
root_resource = OptionsResource() | ||||||||||
|
||||||||||
site = SynapseSite( | ||||||||||
"synapse.access.%s.%s" % ("https" if tls else "http", site_tag), | ||||||||||
site_tag, | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is used here still: synapse/synapse/app/homeserver.py Lines 105 to 108 in ac5184f
|
||||||||||
ports = listen_http( | ||||||||||
listener_config, | ||||||||||
create_resource_tree(resources, root_resource), | ||||||||||
self.version_string, | ||||||||||
max_request_body_size=max_request_body_size(self.config), | ||||||||||
max_request_body_size(self.config), | ||||||||||
self.tls_server_context_factory, | ||||||||||
reactor=self.get_reactor(), | ||||||||||
) | ||||||||||
|
||||||||||
if tls: | ||||||||||
# refresh_certificate should have been called before this. | ||||||||||
assert self.tls_server_context_factory is not None | ||||||||||
ports = listen_ssl( | ||||||||||
bind_addresses, | ||||||||||
port, | ||||||||||
site, | ||||||||||
self.tls_server_context_factory, | ||||||||||
reactor=self.get_reactor(), | ||||||||||
) | ||||||||||
logger.info("Synapse now listening on TCP port %d (TLS)", port) | ||||||||||
|
||||||||||
else: | ||||||||||
ports = listen_tcp( | ||||||||||
bind_addresses, | ||||||||||
port, | ||||||||||
site, | ||||||||||
reactor=self.get_reactor(), | ||||||||||
) | ||||||||||
logger.info("Synapse now listening on TCP port %d", port) | ||||||||||
|
||||||||||
return ports | ||||||||||
|
||||||||||
def _configure_named_resource( | ||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be
Optional[IOpenSSLContextFactory]
, I think.