mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 06:15:36 -04:00
Comment _pyopenssl_cert_or_req_san method
This commit is contained in:
parent
710eb59f41
commit
32957cc5ec
1 changed files with 4 additions and 1 deletions
|
|
@ -169,11 +169,14 @@ def _pyopenssl_cert_or_req_san(cert_or_req):
|
|||
func = OpenSSL.crypto.dump_certificate
|
||||
else:
|
||||
func = OpenSSL.crypto.dump_certificate_request
|
||||
|
||||
# This method of finding SANs is used to support PyOpenSSL version 0.13.
|
||||
text = func(OpenSSL.crypto.FILETYPE_TEXT, cert_or_req).decode("utf-8")
|
||||
match = re.search(r"X509v3 Subject Alternative Name:\s*(.*)", text)
|
||||
sans_parts = [] if match is None else match.group(1).split(parts_separator)
|
||||
|
||||
# WARNING: this function assumes that no SAN can include
|
||||
# parts_separator, hence the split!
|
||||
sans_parts = [] if match is None else match.group(1).split(parts_separator)
|
||||
|
||||
return [part.split(part_separator)[1]
|
||||
for part in sans_parts if part.startswith(prefix)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue