sans_text_dump_comment += 1

This commit is contained in:
Brad Warren 2016-01-07 21:11:09 -05:00
parent 946f4474da
commit 639cbeb7d0

View file

@ -160,6 +160,12 @@ def _pyopenssl_cert_or_req_san(cert_or_req):
:rtype: `list` of `unicode`
"""
# This function finds SANs by dumping the certificate/CSR to text and
# searching for "X509v3 Subject Alternative Name" in the text. This method
# is used to support PyOpenSSL version 0.13 where the
# `_subjectAltNameString` and `get_extensions` methods are not available
# for CSRs.
# constants based on PyOpenSSL certificate/CSR text dump
part_separator = ":"
parts_separator = ", "
@ -169,7 +175,6 @@ 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")
# WARNING: this function does not support multiple SANs extensions.
# Multiple X509v3 extensions of the same type is disallowed by RFC 5280.