Skip to content

Commit

Permalink
Regex fix for CSR SAN with multiple domains (issue: linebreaks)
Browse files Browse the repository at this point in the history
See diafygi#264

Signed-off-by: bastelflp <[email protected]>
  • Loading branch information
bastelflp committed Aug 10, 2021
1 parent f58aa96 commit d0831aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion acme_tiny.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _poll_until_not(url, pending_statuses, err_msg):
common_name = re.search(r"Subject:.*? CN\s?=\s?([^\s,;/]+)", out.decode('utf8'))
if common_name is not None:
domains.add(common_name.group(1))
subject_alt_names = re.search(r"X509v3 Subject Alternative Name: (?:critical)?\n +([^\n]+)\n", out.decode('utf8'), re.MULTILINE|re.DOTALL)
subject_alt_names = re.search(r"X509v3 Subject Alternative Name: (?:critical)?\r?\n +([^\r?\n]+)\r?\n", out.decode('utf8'), re.MULTILINE|re.DOTALL)
if subject_alt_names is not None:
for san in subject_alt_names.group(1).split(", "):
if san.startswith("DNS:"):
Expand Down

0 comments on commit d0831aa

Please sign in to comment.