diff options
Diffstat (limited to 'monitor')
-rwxr-xr-x | monitor/josef_experimental.py | 8 | ||||
-rw-r--r-- | monitor/josef_lib.py | 14 |
2 files changed, 15 insertions, 7 deletions
diff --git a/monitor/josef_experimental.py b/monitor/josef_experimental.py index 3919c84..c08368d 100755 --- a/monitor/josef_experimental.py +++ b/monitor/josef_experimental.py @@ -192,8 +192,8 @@ if __name__ == '__main__': # Experimental if False: - log = CTLOGS[2] - entries = get_entries(log["url"],4074 ,4074)["entries"] + log = CTLOGS[1] + entries = get_entries(log["url"],187851 ,187851)["entries"] entry = entries[0] print check_domain_all(entry) # res = check_domain_extended(entry) @@ -201,7 +201,7 @@ if __name__ == '__main__': # Data gathering for Niklas if True: - logs = [CTLOGS[2],CTLOGS[3],CTLOGS[4],CTLOGS[7],CTLOGS[8],CTLOGS[9]] + logs = [CTLOGS[1]] #,CTLOGS[4],CTLOGS[7],CTLOGS[8],CTLOGS[9]] for log in logs: filename = log["name"] + "_content.txt" if os.path.exists(filename): @@ -217,7 +217,7 @@ if __name__ == '__main__': while start + idx < end: entries = get_entries(log["url"],start + idx ,end)["entries"] - print log["name"] + ": Got " + str(start + idx) + " to " + str(start + idx + len(entries) - 1) + print time_str() + " " + log["name"] + ": Got " + str(start + idx) + " to " + str(start + idx + len(entries) - 1) with open(filename, 'a') as f: for i in range(len(entries)): diff --git a/monitor/josef_lib.py b/monitor/josef_lib.py index 5ee6255..24c74c3 100644 --- a/monitor/josef_lib.py +++ b/monitor/josef_lib.py @@ -235,7 +235,11 @@ def my_get_cert_info(s): if "Subject:" in line: result["subject"] = line.split("Subject: ")[1] if "Issuer:" in line: - result["issuer"] = line.split("Issuer: ")[1] + try: + result["issuer"] = line.split("Issuer: ")[1] + except: + print line + sys.exit() if "Subject Alternative Name" in prev: result["SAN"] = line.lstrip() if "Not After" in line: @@ -262,8 +266,12 @@ def my_get_more_cert_info(s): for line in parsed[0].split("\n"): if "Subject:" in line: result["subject"] = line.split("Subject: ")[1] - if "Issuer:" in line: - result["issuer"] = line.split("Issuer: ")[1] + if " Issuer:" in line: + try: + result["issuer"] = line.split("Issuer: ")[1] + except: + print line + sys.exit() if "Public-Key:" in line: result["keylength"] = line.split(':')[1][2:-5] if "Signature Algorithm:" in line: |