Skip to content

Commit

Permalink
fix cert name display
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed May 6, 2024
1 parent 28d6e76 commit a8fe987
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions checks/tasks/tls/scans.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,8 @@ def cert_checks(hostname, mode, task, af_ip_pair=None, dane_cb_data=None, *args,

# Extract all names from a certificate, taken from sslyze' _cert_chain_analyzer.py
subj_alt_name_ext = parse_subject_alternative_name_extension(leaf_cert)
subj_alt_name_as_list = [("DNS", name) for name in subj_alt_name_ext.dns_names]
subj_alt_name_as_list.extend([("IP Address", ip) for ip in subj_alt_name_ext.ip_addresses])
certificate_names = {
"subject": (tuple([("commonName", name) for name in get_common_names(leaf_cert.subject)]),),
"subjectAltName": tuple(subj_alt_name_as_list),
}
hostmatch_bad = certificate_names
certificate_names = set(get_common_names(leaf_cert.subject) + subj_alt_name_ext.dns_names + subj_alt_name_ext.ip_addresses)
hostmatch_bad = ", ".join(certificate_names)

trusted_score = (
trusted_score_good
Expand Down

0 comments on commit a8fe987

Please sign in to comment.