forked from Hay1tsme/artemis
pokken: add ssl_enable
This commit is contained in:
parent
b105418431
commit
6b265ea866
@ -16,6 +16,10 @@ class PokkenServerConfig():
|
|||||||
def hostname(self) -> str:
|
def hostname(self) -> str:
|
||||||
return CoreConfig.get_config_field(self.__config, 'pokken', 'server', 'hostname', default="localhost")
|
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
|
@property
|
||||||
def port(self) -> int:
|
def port(self) -> int:
|
||||||
return CoreConfig.get_config_field(self.__config, 'pokken', 'server', 'port', default=9000)
|
return CoreConfig.get_config_field(self.__config, 'pokken', 'server', 'port', default=9000)
|
||||||
|
@ -42,7 +42,7 @@ class PokkenServlet(resource.Resource):
|
|||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
if self.game_cfg.server.enable:
|
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}"\
|
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":interface={self.game_cfg.server.hostname}:privateKey={self.game_cfg.server.ssl_key}:"\
|
||||||
f"certKey={self.game_cfg.server.ssl_cert}")\
|
f"certKey={self.game_cfg.server.ssl_cert}")\
|
||||||
|
Loading…
Reference in New Issue
Block a user