Changeset - c01402cc810c
[Not reviewed]
main
1 3 1
x - 10 months ago 2024-06-02 14:13:05
xbr@c3l.lu
feat: web is now https, which is a special case of tls
4 files changed with 16 insertions and 5 deletions:
0 comments (0 inline, 0 general)
backend/check_domains.py
Show inline comments
 
@@ -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)
backend/generic_handler.py
Show inline comments
 
@@ -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")
 

	
backend/input.json
Show inline comments
 
{
 
    "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}
 
        ],
backend/sslh.py
Show inline comments
 
file renamed from backend/web.py to backend/sslh.py
0 comments (0 inline, 0 general)