Fixes acm:describe_certificate for imported certificates having no SAN extension (#3370)
* Fix(test_acm): describe_certificate testcase does't execute * handle acm certificates lacking extensions Co-authored-by: nom3ad <nom3ad@gmail.com>
This commit is contained in:
parent
c54f182ca1
commit
502818be4c
@ -293,9 +293,12 @@ class CertBundle(BaseModel):
|
||||
key_algo = "EC_prime256v1"
|
||||
|
||||
# Look for SANs
|
||||
san_obj = self._cert.extensions.get_extension_for_oid(
|
||||
cryptography.x509.OID_SUBJECT_ALTERNATIVE_NAME
|
||||
)
|
||||
try:
|
||||
san_obj = self._cert.extensions.get_extension_for_oid(
|
||||
cryptography.x509.OID_SUBJECT_ALTERNATIVE_NAME
|
||||
)
|
||||
except cryptography.x509.ExtensionNotFound:
|
||||
san_obj = None
|
||||
sans = []
|
||||
if san_obj is not None:
|
||||
sans = [item.value for item in san_obj.value]
|
||||
|
@ -140,7 +140,7 @@ def test_describe_certificate():
|
||||
|
||||
|
||||
@mock_acm
|
||||
def test_describe_certificate():
|
||||
def test_describe_certificate_with_bad_arn():
|
||||
client = boto3.client("acm", region_name="eu-central-1")
|
||||
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user