mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 16:22:18 -04:00
Simplify get_names_from_csr
This commit is contained in:
parent
8e17d7498d
commit
77e4be933c
1 changed files with 1 additions and 3 deletions
|
|
@ -284,10 +284,8 @@ def get_names_from_csr(csr, typ=OpenSSL.crypto.FILETYPE_PEM):
|
|||
"""
|
||||
loaded_csr = _load_cert_or_req(
|
||||
csr, OpenSSL.crypto.load_certificate_request, typ)
|
||||
common_name = loaded_csr.get_subject().CN
|
||||
|
||||
# Use a set to avoid duplication with CN and Subject Alt Names
|
||||
domains = set() if common_name is None else set((common_name,))
|
||||
domains = set(d for d in (loaded_csr.get_subject().CN,) if d is not None)
|
||||
# pylint: disable=protected-access
|
||||
domains.update(acme_crypto_util._pyopenssl_cert_or_req_san(loaded_csr))
|
||||
return list(domains)
|
||||
|
|
|
|||
Loading…
Reference in a new issue