Files
@ c01402cc810c
Branch filter:
Location: C3L-NOC/tls-expiry-tracker/backend/check_domains.py - annotation
c01402cc810c
1.2 KiB
text/x-python
feat: web is now https, which is a special case of tls
bb749f282c4e bb749f282c4e bb749f282c4e d0238a1adb40 bb749f282c4e c11dd0c93877 d0238a1adb40 d0238a1adb40 d0238a1adb40 d0238a1adb40 d0238a1adb40 d0238a1adb40 d0238a1adb40 d0238a1adb40 d0238a1adb40 d0238a1adb40 d0238a1adb40 d0238a1adb40 d0238a1adb40 c11dd0c93877 c01402cc810c c01402cc810c c01402cc810c c01402cc810c c01402cc810c c01402cc810c c01402cc810c c01402cc810c b3456703e541 d0238a1adb40 d0238a1adb40 c01402cc810c c11dd0c93877 d0238a1adb40 d0238a1adb40 d0238a1adb40 c01402cc810c c11dd0c93877 d0238a1adb40 | #!/usr/bin/env python3
import json
import ssl
import os
from rich.console import Console
from generic_handler import Verificator
if __name__ == "__main__":
console = Console()
# Parse the input file
path = os.path.split(__file__)[0] + "/"
with open(path + 'input.json') as raw_data:
input = json.load(raw_data)
context = ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH)
console.log("[white]Checking web domains...")
v = Verificator(context)
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)
|