diff --git a/server.py b/server.py
index 426702b..0e79adf 100644
--- a/server.py
+++ b/server.py
@@ -33,19 +33,21 @@ def loadcert_backend():
if 'privkey' not in request.files:
return "Invalid request. (privkey is missing!)"
cert = request.files['cert'].read()
- privkey = request.files['privkey'].read()
+ privkey = request.files['privkey']
+ certt = cert.read()
+ privkeyy = privkey.read()
if cert.filename == '' or privkey.filename == '':
return "Please upload a certificate and private key."
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() == privkey) and (open(homefolder + "/certs/" + thisname + "-chain.pem").read() == cert):
+ if (open(homefolder + "/certs/" + thisname + "-privkey.pem").read() == privkeyy) and (open(homefolder + "/certs/" + thisname + "-chain.pem").read() == certt):
resp = make_response('The certificate seems to already exist, loading the used file.