Fixing tests

This commit is contained in:
kevgliss
2015-07-22 10:51:55 -07:00
parent da004aa88f
commit 8d576aa3d8
7 changed files with 29 additions and 64 deletions

View File

@ -51,6 +51,7 @@ def create_name(issuer, not_before, not_after, subject, san):
# aws doesn't allow special chars except '-'
disallowed_chars = ''.join(c for c in map(chr, range(256)) if not c.isalnum())
disallowed_chars = disallowed_chars.replace("-", "")
disallowed_chars = disallowed_chars.replace(".", "")
temp = temp.replace('*', "WILDCARD")
temp = temp.translate(None, disallowed_chars)
# white space is silly too
@ -76,7 +77,7 @@ def cert_get_domains(cert):
return the common name.
:param cert:
:return: List of domainss
:return: List of domains
"""
domains = []
try:
@ -86,6 +87,7 @@ def cert_get_domains(cert):
domains.append(entry)
except Exception as e:
current_app.logger.warning("Failed to get SubjectAltName: {0}".format(e))
return domains
@ -122,6 +124,9 @@ def cert_is_wildcard(cert):
if len(domains) == 1 and domains[0][0:1] == "*":
return True
if cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value[0:1] == "*":
return True
def cert_get_bitstrength(cert):
"""