From d20965131cc2bd66c11a6e64bcec52e4a0ee2e23 Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Mon, 20 Mar 2017 21:22:06 +0100 Subject: [PATCH] Fix TLS support Clearly, I have no python skills hence this bug :( --- python_apps/api_clients/api_clients/api_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python_apps/api_clients/api_clients/api_client.py b/python_apps/api_clients/api_clients/api_client.py index 3174e273a..e3a08e0b3 100644 --- a/python_apps/api_clients/api_clients/api_client.py +++ b/python_apps/api_clients/api_clients/api_client.py @@ -187,7 +187,7 @@ class RequestProvider(object): if self.config["general"]["base_dir"].startswith("/"): self.config["general"]["base_dir"] = self.config["general"]["base_dir"][1:] self.url = ApcUrl("%s://%s:%s/%s%s/%s" \ - % (str(("https", "http")[self.config["general"]["base_port"] == 443]), + % (str(("http", "https")[int(self.config["general"]["base_port"]) == 443]), self.config["general"]["base_url"], str(self.config["general"]["base_port"]), self.config["general"]["base_dir"], self.config["api_base"], '%%action%%')) @@ -325,7 +325,7 @@ class AirtimeApiClient(object): if self.config["general"]["base_dir"].startswith("/"): self.config["general"]["base_dir"] = self.config["general"]["base_dir"][1:] url = "%s://%s:%s/%s%s/%s" % \ - (str(("https", "http")[self.config["general"]["base_port"] == 443]), + (str(("http", "https")[int(self.config["general"]["base_port"]) == 443]), self.config["general"]["base_url"], str(self.config["general"]["base_port"]), self.config["general"]["base_dir"], self.config["api_base"], self.config[config_action_key])