diff --git a/backend/check_domains.py b/backend/check_domains.py index fa1f3b46b467ce83450f65d9ae18fc4e25351125..66063b9e87e6b2b2ca5be45759b6705d74ef884b 100644 --- a/backend/check_domains.py +++ b/backend/check_domains.py @@ -18,14 +18,22 @@ if __name__ == "__main__": console.log("[white]Checking web domains...") v = Verificator(context) - for web_domain in input["domains"]["web"]: - result = v.connect(web_domain, 443, "ssl") + for https_entry in input["domains"]["https"]: + # HTTPS (TLS) w/ 443 + result = v.connect(https_entry, 443, "ssl") + result.print(console) + + for tls_entry in input["domains"]["tls"]: + # TLS w/ custom port + result = v.connect(tls_entry["host"], tls_entry["port"], "ssl") result.print(console) for smtp_entry in input["domains"]["smtp"]: + # SMTP w/ STARTTLS result = v.connect(smtp_entry["host"], smtp_entry["port"], "smtp") result.print(console) for imap_entry in input["domains"]["imap"]: + # IMAP w/ STARTTLS result = v.connect(imap_entry["host"], imap_entry["port"], "imap") result.print(console) diff --git a/backend/generic_handler.py b/backend/generic_handler.py index 1c3fcee7595fd6e37127280980440153ab81b741..3b88eb62302ea3f54f484e1e5a7a2bd508fae33a 100644 --- a/backend/generic_handler.py +++ b/backend/generic_handler.py @@ -14,13 +14,13 @@ class GenericHandler(ABC): @staticmethod def create_handler(protocol: str): - import web, mail + import sslh, mail if protocol == "smtp": return mail.SMTPHandler elif protocol == "imap": return mail.IMAPHandler elif protocol == "ssl" or protocol == "tls" or protocol == "https": - return web.SSLHandler + return sslh.SSLHandler else: raise ValueError("Invalid protocol") diff --git a/backend/input.json b/backend/input.json index 039b8cd9c82d4827904f894c2848cb4573a7ad1e..658c4f7a3f4b3adad8a01361b743b09a8c9351c5 100644 --- a/backend/input.json +++ b/backend/input.json @@ -1,6 +1,6 @@ { "domains": { - "web": [ + "https": [ "expired.badssl.com", "wrong.host.badssl.com", "self-signed.badssl.com", @@ -34,6 +34,9 @@ "firmware.freifunk.lu", "map.freifunk.lu" ], + "tls" : [ + {"host": "example.org", "port": 443} + ], "smtp": [ {"host": "smtp.c3l.lu", "port": 587} ], diff --git a/backend/web.py b/backend/sslh.py similarity index 100% rename from backend/web.py rename to backend/sslh.py