Skip to content

Commit

Permalink
FIX CN parsing to work with OpenSSL 1.1
Browse files Browse the repository at this point in the history
diafygi/acme-tiny@9537453

CN used to be without whitespaces around the `=` but OpenSSL 1.1 introduced
whitespaces:
1.0.1: subject=/CN=example.com
1.1.0: subject=CN = example.com

This commit makes them optional.
  • Loading branch information
manusfreedom committed Jul 6, 2017
1 parent 5b0b18a commit 8ae8d9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webmin/acme_tiny.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _send_signed_request(url, payload):
if proc.returncode != 0:
raise IOError("Error loading {0}: {1}".format(csr, err))
domains = set([])
common_name = re.search(r"Subject:.*? CN=([^\s,;/]+)", out.decode('utf8'))
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))
alt_names = re.search(r"Subject:.*subjectAltName=([^\s,;/]+)", out.decode('utf8'))
Expand Down

0 comments on commit 8ae8d9a

Please sign in to comment.