diff --git a/server.py b/server.py
index d2deba7..6cbeeee 100644
--- a/server.py
+++ b/server.py
@@ -37,10 +37,16 @@ def loadcert_backend():
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.read() and open(homefolder + "/certs/" + thisname + "-chain.pem").read() == cert.read():
+ resp = make_response('The certificate seems to already exist, loading the used file.
The specified Gemini server wants more data:
{i}' + return f'\n
The specified Gemini server wants more data:
{i}' elif i.split(" ")[0][0] == "6": - return f'\n
The specified Gemini server wants a client certificate, or the certificate is invalid.
{i}
You can load a certificate in home page.
' + return f'\nThe specified Gemini server wants a client certificate, or the certificate is invalid.
{i}
You can load a certificate in home page.
' elif i.split(" ")[0][0] != "2": - return f'\nThe specified Gemini server returned a status of: {i}
' + return f'\nThe specified Gemini server returned a status of: {i}
' else: firstline = False if i.split(" ")[1].split(";")[0] != "text/gemini": @@ -246,7 +252,7 @@ def relay(): title = "gemini://" + url except: code += "" + traceback.format_exc() + "" - return f'\n