mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Listen using SSL
This commit is contained in:
parent
f5755bcadf
commit
ef6a8e4f32
@ -29,6 +29,7 @@ from synapse.api.urls import (
|
|||||||
CLIENT_PREFIX, FEDERATION_PREFIX, WEB_CLIENT_PREFIX, CONTENT_REPO_PREFIX
|
CLIENT_PREFIX, FEDERATION_PREFIX, WEB_CLIENT_PREFIX, CONTENT_REPO_PREFIX
|
||||||
)
|
)
|
||||||
from synapse.config.homeserver import HomeServerConfig
|
from synapse.config.homeserver import HomeServerConfig
|
||||||
|
from synapse.crypto import context_factory
|
||||||
|
|
||||||
from daemonize import Daemonize
|
from daemonize import Daemonize
|
||||||
import twisted.manhole.telnet
|
import twisted.manhole.telnet
|
||||||
@ -206,7 +207,9 @@ class SynapseHomeServer(HomeServer):
|
|||||||
return "%s-%s" % (resource, path_seg)
|
return "%s-%s" % (resource, path_seg)
|
||||||
|
|
||||||
def start_listening(self, port):
|
def start_listening(self, port):
|
||||||
reactor.listenTCP(port, Site(self.root_resource))
|
reactor.listenSSL(
|
||||||
|
port, Site(self.root_resource), self.tls_context_factory
|
||||||
|
)
|
||||||
logger.info("Synapse now listening on port %d", port)
|
logger.info("Synapse now listening on port %d", port)
|
||||||
|
|
||||||
|
|
||||||
@ -230,11 +233,14 @@ def setup():
|
|||||||
else:
|
else:
|
||||||
domain_with_port = "%s:%s" % (config.server_name, config.bind_port)
|
domain_with_port = "%s:%s" % (config.server_name, config.bind_port)
|
||||||
|
|
||||||
|
tls_context_factory = context_factory.ServerContextFactory(config)
|
||||||
|
|
||||||
hs = SynapseHomeServer(
|
hs = SynapseHomeServer(
|
||||||
config.server_name,
|
config.server_name,
|
||||||
domain_with_port=domain_with_port,
|
domain_with_port=domain_with_port,
|
||||||
upload_dir=os.path.abspath("uploads"),
|
upload_dir=os.path.abspath("uploads"),
|
||||||
db_name=config.database_path,
|
db_name=config.database_path,
|
||||||
|
tls_context_factory=tls_context_factory,
|
||||||
)
|
)
|
||||||
|
|
||||||
hs.register_servlets()
|
hs.register_servlets()
|
||||||
|
@ -28,7 +28,7 @@ class ServerConfig(Config):
|
|||||||
self.bind_host = args.bind_host
|
self.bind_host = args.bind_host
|
||||||
self.daemonize = args.daemonize
|
self.daemonize = args.daemonize
|
||||||
self.pid_file = self.abspath(args.pid_file)
|
self.pid_file = self.abspath(args.pid_file)
|
||||||
self.webclient = not args.no_webclient
|
self.webclient = args.no_webclient
|
||||||
self.manhole = args.manhole
|
self.manhole = args.manhole
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user