Update server.py

This commit is contained in:
Nova Cat 2025-01-15 21:44:07 -08:00
parent c9a28d9022
commit 2152967094

View file

@ -40,6 +40,8 @@ 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])
print(thisname)
print(homefolder + "/certs/" + thisname + "-privkey.pem")
if (open(homefolder + "/certs/" + thisname + "-privkey.pem").read() == privkey.read()) and (open(homefolder + "/certs/" + thisname + "-chain.pem").read() == cert.read()):
resp = make_response('<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/style.css">The certificate seems to already exist, loading the used file.<br><br><p><a href="/" class=go style="color: white;">Go home</a></p>')
resp.set_cookie('certname',thisname)