diff --git a/jupyterhub_traefik_proxy/proxy.py b/jupyterhub_traefik_proxy/proxy.py index c7f184b0..2f7e8b7f 100644 --- a/jupyterhub_traefik_proxy/proxy.py +++ b/jupyterhub_traefik_proxy/proxy.py @@ -209,11 +209,24 @@ async def _setup_traefik_static_config(self): self._generate_htpassword() self.static_config = {} - self.static_config["defaultentrypoints"] = ["http"] self.static_config["debug"] = True self.static_config["logLevel"] = self.traefik_log_level entryPoints = {} - entryPoints["http"] = {"address": ":" + str(urlparse(self.public_url).port)} + + if self.ssl_cert and self.ssl_key: + self.static_config["defaultentrypoints"] = ["https"] + entryPoints["https"] = { + "address": ":" + str(urlparse(self.public_url).port), + "tls": { + "certificates": [ + {"certFile": self.ssl_cert, "keyFile": self.ssl_key} + ] + }, + } + else: + self.static_config["defaultentrypoints"] = ["http"] + entryPoints["http"] = {"address": ":" + str(urlparse(self.public_url).port)} + auth = { "basic": { "users": [ diff --git a/requirements.txt b/requirements.txt index 17eacf10..440f8679 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ jupyterhub>=0.9 etcd3 -aiohttp +aiohttp==3.6.2 python-consul passlib toml