Skip to content

Commit

Permalink
get_cn_from_csr should return None when no CN present
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcrawford45 committed Nov 30, 2023
1 parent 9354d52 commit 0e69a2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lemur/certificates/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def get_cn_from_csr(data):
raise ValidationError("CSR presented is not valid.")

common_name = request.subject.get_attributes_for_oid(x509.NameOID.COMMON_NAME)
if not common_name:
return None
return common_name[0].value


Expand Down

0 comments on commit 0e69a2e

Please sign in to comment.