From 487a86e57e236ebe23c41a386aba0659030999ec Mon Sep 17 00:00:00 2001 From: swee Date: Wed, 15 Jan 2025 21:53:05 -0800 Subject: [PATCH] Update server.py --- server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 2fb0771..9117a1b 100644 --- a/server.py +++ b/server.py @@ -41,13 +41,13 @@ def loadcert_backend(): if allowed_file(cert.filename) and allowed_file(privkey.filename): for i in os.listdir(homefolder + "/certs/"): thisname = "-".join(i.split("-")[:-1]) - if (open(homefolder + "/certs/" + thisname + "-privkey.pem").read() == privkeyy) and (open(homefolder + "/certs/" + thisname + "-chain.pem").read() == certt): + if (open(homefolder + "/certs/" + thisname + "-privkey.pem").read() == privkeyy.decode()) and (open(homefolder + "/certs/" + thisname + "-chain.pem").read() == certt.decode()): resp = make_response('The certificate seems to already exist, loading the used file.

Go home

') resp.set_cookie('certname',thisname) return resp random_name = str(uuid.uuid4()) - open(homefolder + "/certs/" + random_name + "-chain.pem", 'w').write(certt) - open(homefolder + "/certs/" + random_name + "-privkey.pem", 'w').write(privkeyy) + open(homefolder + "/certs/" + random_name + "-chain.pem", 'wb').write(certt) + open(homefolder + "/certs/" + random_name + "-privkey.pem", 'wb').write(privkeyy) resp = make_response('Success!

Go home

') resp.set_cookie('certname',random_name) return resp