From 6b265ea866fe50f84b3722b64dc3076c37942730 Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Fri, 24 Feb 2023 13:27:37 -0500 Subject: [PATCH] pokken: add ssl_enable --- titles/pokken/config.py | 4 ++++ titles/pokken/index.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/titles/pokken/config.py b/titles/pokken/config.py index 1221c08..4eb07c6 100644 --- a/titles/pokken/config.py +++ b/titles/pokken/config.py @@ -16,6 +16,10 @@ class PokkenServerConfig(): def hostname(self) -> str: return CoreConfig.get_config_field(self.__config, 'pokken', 'server', 'hostname', default="localhost") + @property + def ssl_enable(self) -> bool: + return CoreConfig.get_config_field(self.__config, 'pokken', 'server', 'ssl_enable', default=False) + @property def port(self) -> int: return CoreConfig.get_config_field(self.__config, 'pokken', 'server', 'port', default=9000) diff --git a/titles/pokken/index.py b/titles/pokken/index.py index d0b3efd..facbd52 100644 --- a/titles/pokken/index.py +++ b/titles/pokken/index.py @@ -42,7 +42,7 @@ class PokkenServlet(resource.Resource): def setup(self): if self.game_cfg.server.enable: - if self.core_cfg.server.is_develop: + if self.core_cfg.server.is_develop and self.game_cfg.server.ssl_enable: endpoints.serverFromString(reactor, f"ssl:{self.game_cfg.server.port}"\ f":interface={self.game_cfg.server.hostname}:privateKey={self.game_cfg.server.ssl_key}:"\ f"certKey={self.game_cfg.server.ssl_cert}")\