Engineering / Field note
One ALB certificate can appear twice in the listener inventory
A default certificate can also belong to the SNI certificate list. Five local Python examples preserve roles, pagination and listener scope without mistaking rows for quota headroom.
An Application Load Balancer certificate inventory can contain the same certificate ARN twice without reporting two different certificates. AWS documents that DescribeListenerCertificates returns separate entries when a certificate is both the listener default and a member of its certificate list. One entry has IsDefault true; the other has it false. A tidy spreadsheet can become less accurate when it removes that distinction. [1]
This is an established API behavior, reviewed against the public AWS documentation on December 1, 2026. It is not a new vulnerability, outage report or service announcement. The five Python examples below use fictional certificate and listener labels rather than real ARNs. They inspect local data only; none connects to AWS or changes a listener.
One certificate, two relationships
Think of the ARN as the certificate identity and the flag as part of its relationship with this listener. Our first example deliberately repeats cert-A. Reducing the rows to unique ARNs answers how many identities were observed. Keeping the pairs answers a different question: which roles were observed? Both answers can be useful, but they are not interchangeable.
rows = [
{"CertificateArn": "cert-A", "IsDefault": True},
{"CertificateArn": "cert-A", "IsDefault": False},
]
identities = {row["CertificateArn"] for row in rows}
relationships = {
(row["CertificateArn"], row["IsDefault"]) for row in rows
}
assert len(identities) == 1
assert len(relationships) == 2This matters when an inventory feeds a review or change plan. A dictionary keyed only by certificate ARN can let the last row overwrite the first. The surviving row may be perfectly valid while the resulting report silently loses a role. Preserve the relationships first, then build whatever summary the reader actually needs.
Default does not automatically mean listed for SNI
AWS distinguishes the default certificate from the certificate list used for Server Name Indication, or SNI. Its guide says a default certificate participates in SNI selection only when it has been added to that list. The console can add it during listener creation; other creation paths can leave the list empty. Inspect the returned roles rather than assuming how the listener was created. [2]
The Certificate API model defines IsDefault as a Boolean in listener-certificate output. Our illustrative parser rejects a missing or incorrectly typed flag instead of interpreting every false-looking value as list membership. That is an application review rule, not a claim that AWS emits these malformed fixtures. [3]
def role(row):
flag = row.get("IsDefault")
if type(flag) is not bool:
raise ValueError("Default role is unknown")
return "default" if flag else "certificate-list"
rows = [{"CertificateArn": "cert-A", "IsDefault": True}]
listed = {r["CertificateArn"] for r in rows
if role(r) == "certificate-list"}
assert listed == set()
try:
role({"CertificateArn": "cert-A"})
except ValueError:
pass
else:
raise AssertionError("Missing role was silently accepted")Finish the pages before describing the whole listener
DescribeListenerCertificates is paginated. A NextMarker means more results remain, and the next request supplies that value as Marker. The third example models two already collected pages. The first contains the default relationship; the second contains list membership for the same identity. Reviewing only the first would support a narrower observation than reviewing both. [1]
def complete_rows(pages):
rows, expected = [], None
for supplied_marker, response in pages:
if supplied_marker != expected:
raise ValueError("Page chain is incomplete")
rows.extend(response["Certificates"])
expected = response.get("NextMarker")
if not pages or expected:
raise ValueError("More pages are required")
return rows
pages = [
(None, {"Certificates": [
{"CertificateArn": "cert-A", "IsDefault": True}
], "NextMarker": "page-2"}),
("page-2", {"Certificates": [
{"CertificateArn": "cert-A", "IsDefault": False}
], "NextMarker": None}),
]
assert len(complete_rows(pages)) == 2This helper checks the marker chain and its terminal state in a tiny local fixture. It is not an AWS paginator or a production collector. A real collector also needs bounded requests, error handling and fresh observations. A partial read should stay visibly partial rather than acquiring a confident total during formatting.
Keep the listener in the record
The API request is scoped to a listener. Consequently, a certificate inventory assembled from several listeners needs to retain that scope. Our fourth example records three observed relationships for one certificate across two listeners. It does not invent a default relationship for the second listener or assert that its remaining inventory has been collected. [1]
observations = [
("listener-one", "cert-A", "default"),
("listener-one", "cert-A", "certificate-list"),
("listener-two", "cert-A", "certificate-list"),
]
by_certificate = {certificate for _, certificate, _ in observations}
scoped_roles = set(observations)
assert len(by_certificate) == 1
assert len(scoped_roles) == 3
assert ("listener-two", "cert-A", "default") not in scoped_rolesQuota planning adds another scope to check. AWS currently lists an adjustable default of 25 certificates per Application Load Balancer, excluding default certificates. That is a load-balancer quota, while this API describes a listener. Neither a deduplicated ARN list nor these teaching fixtures establish an account’s applied quota or available capacity. Review those separately before proposing an addition. [4]
Compare role changes, not just names
AWS provides separate operations for replacing the default certificate and updating certificate-list membership. Its listener update guide also describes retaining a previous default in the list. Our final example compares two hypothetical inventories: cert-B becomes the default while cert-A remains listed. The removed default relationship does not mean that cert-A disappeared from the listener. [5] [6]
def relationships(rows):
return {(r["CertificateArn"], r["IsDefault"]) for r in rows}
before = [
{"CertificateArn": "cert-A", "IsDefault": True},
{"CertificateArn": "cert-A", "IsDefault": False},
]
after = [
{"CertificateArn": "cert-B", "IsDefault": True},
{"CertificateArn": "cert-A", "IsDefault": False},
]
removed = relationships(before) - relationships(after)
retained = relationships(before) & relationships(after)
assert removed == {("cert-A", True)}
assert retained == {("cert-A", False)}For a reviewer, that distinction changes the next question from “was this certificate deleted?” to “which relationship changed, and which clients or hostnames depend on it?” It also prevents an inventory cleanup from becoming an accidental configuration decision. A report should explain what it observed before recommending what to remove.
We executed all five examples locally with Python 3.15.2 and checked incomplete-page and invalid-role cases. Those checks establish the examples’ data-handling behavior, not TLS compatibility, successful certificate attachment or an available quota slot. Keep certificate identity, listener role, collection completeness and operational acceptance as separate pieces of evidence. The duplicate row may be doing useful work.
Sources + further reading
Source dates describe the original material. Publication above is the date this Zyel article went live.
- AWS API: DescribeListenerCertificatesAmazon Web Services · Checked Dec 1, 2026
- AWS guide: default certificates and the SNI certificate listAmazon Web Services · Checked Dec 1, 2026
- AWS API: Certificate and IsDefaultAmazon Web Services · Checked Dec 1, 2026
- AWS guide: Application Load Balancer quotasAmazon Web Services · Checked Dec 1, 2026
- AWS guide: update an HTTPS listenerAmazon Web Services · Checked Dec 1, 2026
- AWS API: AddListenerCertificatesAmazon Web Services · Checked Dec 1, 2026
Reader discussion
What would you ask next?
Questions, useful corrections and thoughtful disagreement are welcome. Comments are reviewed before they appear.
No reader comments yet.