An AWS Application Load Balancer HTTPS listener serves several domains, each with its own ACM certificate attached to the listener. Most clients work fine, but one older client always receives the certificate for a different domain and fails hostname verification. What is happening, and how do you fix it?
answer
- something chose the wrong certificate
- the choice happens before any Host header
- SNI extension in the ClientHello
- no SNI means the listener default
basics
~20 sThat client is not sending the TLS SNI extension. An ALB selects among the certificates on an HTTPS listener by SNI, and falls back to the listener's default certificate when SNI is absent - so the client gets whichever domain is the default and hostname verification fails.
solid answer
~60 sAn ALB HTTPS listener has exactly one **default certificate** and a list of additional certificates. During the handshake the ALB reads the server name from the client's SNI extension and picks the matching certificate; if the client sends no SNI - very old TLS stacks, some embedded devices, or anything connecting by IP address - the ALB has nothing to match on and presents the default certificate. The client then sees a certificate whose names do not include the host it asked for and aborts. Fixes, in order of preference: get the client to send SNI, since it has been standard for many years; or issue one ACM certificate that covers the affected name as a subject alternative name and make it the listener's default; or give that domain its own listener or load balancer where its certificate is the default. While you are there, check the listener's security policy - an old client failing the handshake outright, rather than on the name, usually means it cannot negotiate the policy's TLS versions or ciphers.
code
bash · 8 linesopenssl s_client -connect alb.example.com:443 -servername shop.example.com </dev/null 2>/dev/null \
| openssl x509 -noout -subject -ext subjectAltName
openssl s_client -connect alb.example.com:443 </dev/null 2>/dev/null \
| openssl x509 -noout -subject
aws elbv2 describe-listener-certificates --listener-arn "$LISTENER_ARN" \
--query 'Certificates[?IsDefault==`true`].CertificateArn'go deeper
Know that one ALB HTTPS listener can hold several certificates, that one of them is the default, and that the ALB uses the name the client asks for to choose between them.
Explain why the choice must happen in the handshake, before any Host header exists, and therefore why a client that omits SNI can only ever receive the default certificate.
Diagnose it end to end: reproduce with and without SNI, identify the default certificate, and weigh the fixes - client upgrade, a multi-SAN default certificate, or a dedicated listener - alongside the security policy and renewal story.
Set the platform position on TLS: which policy is the floor, how legacy clients are measured and sunset, whether tenant domains share a certificate at all, and how the certificate-per-load-balancer quota constrains a multi-tenant design.
## How an ALB chooses a certificate A TLS handshake begins with the client's ClientHello. Server Name Indication is an optional extension in that message carrying the hostname the client intends to reach - it exists precisely because the server must choose a certificate *before* any HTTP request (and therefore before any `Host` header) has been sent. An ALB HTTPS listener holds one certificate marked as the default and a list of additional certificates. On each handshake the load balancer looks at the SNI value and selects the certificate whose subject or subject alternative names cover it. When two certificates could serve the name, the ALB prefers the better match and, among equals, the stronger key algorithm. When there is no SNI at all, there is nothing to match on and the listener falls back to its default certificate. That is the whole mechanism, and it explains the symptom exactly: an SNI-less client always sees the default certificate no matter which domain it dialled. ## Confirming it rather than guessing Reproduce both sides of the handshake from a shell: ```bash # with SNI - should show the certificate for the requested host openssl s_client -connect alb.example.com:443 -servername shop.example.com </dev/null 2>/dev/null \ | openssl x509 -noout -subject -ext subjectAltName # without SNI - shows the listener's default certificate openssl s_client -connect alb.example.com:443 </dev/null 2>/dev/null \ | openssl x509 -noout -subject ``` If the second command prints a different subject from the first, you have proven the fallback. On the AWS side, `aws elbv2 describe-listener-certificates --listener-arn ...` shows which entry carries `IsDefault: true`. ## The fixes, and what each costs **Make the client send SNI.** This is the correct fix. Nearly every current TLS stack sends it by default; a client that does not is usually an ancient runtime or a library configured to connect to a literal IP address, in which case there is no name to send. Upgrading or reconfiguring the caller solves the problem permanently and costs nothing on the AWS side. **Cover the name on the default certificate.** ACM can issue a certificate with multiple subject alternative names, including wildcards. If the default certificate lists every domain the listener serves, the fallback path stops mattering. The trade-off is one certificate shared by unrelated domains - the whole name list is visible to anyone who connects, which leaks the fact that those domains are related, and every renewal touches all of them. **Give the stubborn domain its own listener or load balancer.** Two ALBs, or one ALB and a second HTTPS listener on a different port, each with the right default certificate. This costs money and DNS complexity but is unavoidable when several SNI-less clients need different names. ## The adjacent things that break at the same time **Region.** An ACM certificate must be issued or imported in the **same Region** as the load balancer. A certificate created in `us-east-1` simply will not appear when you attach it to an ALB in `eu-west-1` - that Region rule is the one CloudFront imposes, not this one. **Security policy.** The listener's security policy - names look like `ELBSecurityPolicy-TLS13-1-2-2021-06` - fixes the TLS protocol versions and cipher suites the ALB will negotiate. A client too old to send SNI is often also too old for the policy's cipher list, and that failure looks different: the handshake fails outright with a protocol or cipher alert rather than a certificate-name error. Tightening the policy to drop TLS 1.0/1.1 is the right long-term move, but do it knowing which clients you are cutting off, and use the load balancer's TLS-version metrics to find them before you flip it. **Renewal.** ACM-issued certificates validated by DNS renew themselves as long as the validation CNAME stays in the zone and the certificate is in use. Imported certificates do not renew - you must replace them yourself before expiry, and forgetting is a classic self-inflicted outage. **Quotas.** The number of additional certificates you can attach to one ALB is a service quota - as of 2025 the default is 25 beyond the default certificate, and it is adjustable. It is a real constraint on the "one shared ALB for every tenant domain" design, and worth checking in Service Quotas before you commit to that architecture.
- Why can the load balancer not just use the Host header to pick the certificate?Because the certificate is presented during the TLS handshake, and the `Host` header lives in the HTTP request that is only sent afterwards, inside the encrypted channel. The server must commit to a certificate before it can read anything at the HTTP layer, which is exactly the gap SNI was invented to fill.
- An ACM certificate you issued does not appear in the list when attaching it to an ALB. What is the usual cause?It is in the wrong Region, or still pending validation. ACM certificates are regional and must be issued or imported in the same Region as the load balancer; only issued, validated certificates are attachable. The us-east-1 requirement people remember belongs to CloudFront, not ALB.
- How would you safely retire TLS 1.0 and 1.1 on a public ALB?Measure first: the load balancer publishes client TLS negotiation metrics, and access logs record the negotiated protocol, so you can quantify who would break. Then move to a policy that keeps only TLS 1.2 and above, announce it, and cut over in a low-traffic window with a rollback to the previous policy ready - the change is a single listener attribute.
saying these in an interview costs you the question
- The ALB picks the certificate from the HTTP Host header.
- An ACM certificate for an ALB must live in us-east-1.
- Attaching a certificate to the listener is enough; the default does not matter.
- Every TLS client sends SNI, so the fallback never happens.
- Imported certificates renew automatically like ACM-issued ones.