mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-24 05:29:22 -05:00
* Fix typechecking errors introduced in #14128 * Changelog * Correct annotations so that context_factory works if you don't use TLS
This commit is contained in:
parent
63cc56affa
commit
258b5285b6
1
changelog.d/14455.misc
Normal file
1
changelog.d/14455.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Add TLS support for generic worker endpoints.
|
@ -364,8 +364,8 @@ def listen_http(
|
|||||||
root_resource: Resource,
|
root_resource: Resource,
|
||||||
version_string: str,
|
version_string: str,
|
||||||
max_request_body_size: int,
|
max_request_body_size: int,
|
||||||
context_factory: IOpenSSLContextFactory,
|
context_factory: Optional[IOpenSSLContextFactory],
|
||||||
reactor: IReactorSSL = reactor,
|
reactor: ISynapseReactor = reactor,
|
||||||
) -> List[Port]:
|
) -> List[Port]:
|
||||||
port = listener_config.port
|
port = listener_config.port
|
||||||
bind_addresses = listener_config.bind_addresses
|
bind_addresses = listener_config.bind_addresses
|
||||||
|
@ -221,8 +221,6 @@ class HomeServer(metaclass=abc.ABCMeta):
|
|||||||
# instantiated during setup() for future return by get_datastores()
|
# instantiated during setup() for future return by get_datastores()
|
||||||
DATASTORE_CLASS = abc.abstractproperty()
|
DATASTORE_CLASS = abc.abstractproperty()
|
||||||
|
|
||||||
tls_server_context_factory: Optional[IOpenSSLContextFactory]
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
hostname: str,
|
hostname: str,
|
||||||
@ -258,6 +256,9 @@ class HomeServer(metaclass=abc.ABCMeta):
|
|||||||
self._module_web_resources: Dict[str, Resource] = {}
|
self._module_web_resources: Dict[str, Resource] = {}
|
||||||
self._module_web_resources_consumed = False
|
self._module_web_resources_consumed = False
|
||||||
|
|
||||||
|
# This attribute is set by the free function `refresh_certificate`.
|
||||||
|
self.tls_server_context_factory: Optional[IOpenSSLContextFactory] = None
|
||||||
|
|
||||||
def register_module_web_resource(self, path: str, resource: Resource) -> None:
|
def register_module_web_resource(self, path: str, resource: Resource) -> None:
|
||||||
"""Allows a module to register a web resource to be served at the given path.
|
"""Allows a module to register a web resource to be served at the given path.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user