diff --git a/tower/api/base.py b/tower/api/base.py index ac60525c756532cbe921c44f7f7ff15bc03fc4c9..2e7a0a0830227da46ffb6df068ed9c24c2e6d080 100644 --- a/tower/api/base.py +++ b/tower/api/base.py @@ -29,7 +29,7 @@ class BaseHandler(tornado.web.RequestHandler): # Fallback to basic auth_header = self.request.headers.get("Authorization") if auth_header and auth_header.startswith("Basic "): - auth = codecs.decode(auth_header[6:].encode("utf-8"), "base64").decode("utf-8") + auth = codecs.decode(auth_header[6:].encode("utf-8"), "base64") u, p = auth.split(":", 2) au = User.authenticate(u, p) if au.is_active: diff --git a/tower/models/environment.py b/tower/models/environment.py index 4dfedf95c1da8c640db4f48fbcf257251fd3b98d..424aa37380fb445f81312de4a062618d458cd68d 100644 --- a/tower/models/environment.py +++ b/tower/models/environment.py @@ -294,8 +294,8 @@ class Environment(Model): for n in need_cert: conf = json.loads(n.config) - conf["cert"] = str(certificate[s]["cert"].decode()) - conf["cert_key"] = str(certificate[s]["key"].decode()) + conf["cert"] = str(certificate[s]["cert"]) + conf["cert_key"] = str(certificate[s]["key"]) n.config = json.dumps(conf, sort_keys=True) n.save()