diff --git a/awx/main/models/credential.py b/awx/main/models/credential.py index bc0917ca65..b358be65a3 100644 --- a/awx/main/models/credential.py +++ b/awx/main/models/credential.py @@ -214,8 +214,8 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique): # Sanity check: We may potentially receive a full PEM certificate, # and we want to accept these. - cert_begin_re = r'^(-{4,})\s*BEGIN\s+CERTIFICATE\s*(-{4,})' - cert_end_re = r'^(-{4,})\s*END\s+CERTIFICATE\s*(-{4,})' + cert_begin_re = r'(-{4,})\s*BEGIN\s+CERTIFICATE\s*(-{4,})' + cert_end_re = r'(-{4,})\s*END\s+CERTIFICATE\s*(-{4,})' cert_begin_match = re.search(cert_begin_re, data) if cert_begin_match: cert_end_match = re.search(cert_end_re, data)