<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by LakshmiNarayana Reddy on Medium]]></title>
        <description><![CDATA[Stories by LakshmiNarayana Reddy on Medium]]></description>
        <link>https://medium.com/@siri.nari?source=rss-f54a2f63affa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bqtJFGWcV0TKciDX.</url>
            <title>Stories by LakshmiNarayana Reddy on Medium</title>
            <link>https://medium.com/@siri.nari?source=rss-f54a2f63affa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:39:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@siri.nari/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When users access your application running on Amazon ECS Fargate behind an Application Load…]]></title>
            <link>https://medium.com/@siri.nari/when-users-access-your-application-running-on-amazon-ecs-fargate-behind-an-application-load-f5d2c4214a11?source=rss-f54a2f63affa------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5d2c4214a11</guid>
            <dc:creator><![CDATA[LakshmiNarayana Reddy]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 08:31:15 GMT</pubDate>
            <atom:updated>2026-07-29T08:31:15.451Z</atom:updated>
            <content:encoded><![CDATA[<p>When users access your application running on <strong>Amazon ECS Fargate</strong> behind an <strong>Application Load Balancer (ALB)</strong>, an important security question often arises:</p><blockquote>Which certificate is actually validated by the browser? The ALB certificate or the container certificate?</blockquote><p>The answer is straightforward but frequently misunderstood.</p><p>In a typical ECS Fargate + ALB architecture, <strong>the browser validates the certificate presented by the ALB, not the certificate inside the container</strong>. Unless you explicitly configure a second TLS termination layer between the ALB and your application, the container certificate is never seen by the client.</p><p>Let’s walk through the complete TLS journey and understand what happens behind the scenes.</p><p><strong>The TLS Trust Boundary in ECS Fargate</strong></p><p>Consider a common architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ru8jSoq00PDBnTN6hNdpJw.png" /></figure><p>The critical takeaway is:</p><p><strong>The browser’s trust relationship ends at the ALB.</strong></p><p>Everything the browser validates during TLS negotiation comes from the ALB listener, not from the ECS task running your application.</p><p><strong>Step 1: Browser Connects to the ALB</strong></p><p>Before any HTTP request is sent, the browser establishes a TCP connection to the ALB on port 443.</p><p><strong>TCP Three-Way Handshake</strong></p><blockquote>Browser → SYN</blockquote><blockquote>ALB → SYN-ACK</blockquote><blockquote>Browser → ACK</blockquote><p>At this point, a network connection exists, but <strong>nothing is encrypted yet</strong>.</p><p>Immediately after TCP establishment, the TLS handshake begins.</p><p><strong>The ClientHello: “Here’s What I Support”</strong></p><p>The browser initiates TLS by sending a <strong>ClientHello</strong> message.</p><p>This message acts as a capability advertisement and typically contains:</p><p><strong>Supported TLS Versions</strong></p><p>Examples:</p><blockquote>TLS 1.2</blockquote><blockquote>TLS 1.3</blockquote><p><strong>Supported Cipher Suites</strong></p><p>These represent cryptographic combinations the browser can use.</p><p>Examples:</p><blockquote>TLS_AES_128_GCM_SHA256</blockquote><blockquote>ECDHE-RSA-AES256-GCM-SHA384</blockquote><p>Show more lines</p><p><strong>SNI (Server Name Indication)</strong></p><p>This is the hostname the user requested.</p><p>Example:</p><blockquote>app.example.com</blockquote><p>SNI is vital because a single ALB can host multiple domains and certificates.</p><p><strong>ALPN (Application Layer Protocol Negotiation)</strong></p><p>This tells the server which HTTP versions the browser supports.</p><p>Examples:</p><blockquote>h2</blockquote><blockquote>http/1.1</blockquote><p><strong>Cryptographic Parameters</strong></p><p>The ClientHello also contains:</p><ul><li>Random values</li><li>Key shares (TLS 1.3)</li><li>Supported elliptic curves</li><li>Signature algorithms</li></ul><p>In simple terms, the browser is saying:</p><blockquote><em>“These are the security protocols I support. Choose the best compatible option.”</em></blockquote><p><strong>The ServerHello: ALB Responds</strong></p><p>The ALB receives the ClientHello and evaluates it against its TLS policy.</p><p>It replies with a <strong>ServerHello</strong>, indicating:</p><p><strong>Selected TLS Version</strong></p><p>Example:</p><blockquote>TLS 1.3</blockquote><p><strong>Selected Cipher Suite</strong></p><p>Example:</p><blockquote>TLS_AES_128_GCM_SHA256</blockquote><p><strong>Selected Application Protocol</strong></p><p>Example:</p><blockquote>HTTP/2 (h2)</blockquote><p><strong>Server Random</strong></p><p>Used alongside the client random value to derive encryption keys.</p><p><strong>Key Exchange Information</strong></p><p>Required for generating secure session keys.</p><p>At this point, browser and ALB begin establishing cryptographic trust.</p><p><strong>Certificate Chain: Proving Server Identity</strong></p><p>After the ServerHello, the ALB sends its certificate chain.</p><p>A typical chain contains:</p><blockquote>app.example.com</blockquote><blockquote>Intermediate CA</blockquote><blockquote>Trusted Root CA</blockquote><p>The components are:</p><p><strong>Leaf Certificate</strong></p><p>Issued for:</p><p>app.example.com</p><p>or *.example.com</p><p><strong>Intermediate Certificates</strong></p><p>Used to connect the leaf certificate to a trusted root.</p><p><strong>Root Certificate</strong></p><p>Normally not transmitted because browsers already possess trusted root certificates in their trust stores.</p><p><strong>What the Browser Actually Validates</strong></p><p>When the certificate chain arrives, the browser performs several checks.</p><p><strong>1. Hostname Verification</strong></p><p>The requested domain must match the certificate.</p><p>Valid:</p><blockquote>URL: app.example.com</blockquote><blockquote>Certificate SAN:</blockquote><blockquote>app.example.com</blockquote><p>Invalid:</p><blockquote>URL: app.example.com</blockquote><blockquote>Certificate SAN:</blockquote><blockquote>admin.example.com</blockquote><p>Result:</p><blockquote>NET::ERR_CERT_COMMON_NAME_INVALID</blockquote><p><strong>2. Validity Period</strong></p><p>The current time must fall between:</p><blockquote>Not Before</blockquote><blockquote>Not After</blockquote><p>Expired certificates cause immediate warnings or connection failures.</p><p><strong>3. Chain of Trust</strong></p><p>The browser verifies each signature in the chain.</p><blockquote>Leaf Cert</blockquote><blockquote>↓</blockquote><blockquote>Intermediate CA</blockquote><blockquote>↓</blockquote><blockquote>Trusted Root CA</blockquote><p>If any signature is invalid, trust establishment fails.</p><p><strong>4. Trusted Root</strong></p><p>The chain must terminate at a root certificate trusted by the browser or operating system.</p><p>If not:</p><blockquote>NET::ERR_CERT_AUTHORITY_INVALID</blockquote><p><strong>5. Key Usage Validation</strong></p><p>The certificate must be authorized for: <em>TLS Web Server Authentication</em></p><p>A certificate issued for another purpose cannot be used.</p><p><strong>6. Revocation Checking</strong></p><p>The browser may verify whether the certificate has been revoked.</p><p>Mechanisms include:</p><ul><li>OCSP</li><li>CRL</li><li>OCSP Stapling</li></ul><p><strong>Understanding OCSP Stapling</strong></p><p>A certificate might still be within its validity period but revoked due to compromise.</p><p>Traditional flow:</p><p>Browser</p><p>│</p><p>├─ Receives cert</p><p>│</p><p>└─ Contacts CA OCSP responder</p><p>This introduces:</p><ul><li>Additional latency</li><li>External dependency</li><li>Privacy concerns</li></ul><p>With <strong>OCSP stapling</strong>, the ALB retrieves revocation status in advance and includes it directly during the TLS handshake.</p><p>ALB</p><p>│</p><p>├─ Fetches OCSP response</p><p>│</p><p>└─ Sends response during TLS handshake</p><p>Benefits:</p><ul><li>Faster handshakes</li><li>Better privacy</li><li>More reliable revocation checking</li></ul><p><strong>How SNI Enables Multiple HTTPS Sites on One ALB</strong></p><p>Imagine a single ALB serving:</p><blockquote>app.example.com</blockquote><blockquote>admin.example.com</blockquote><blockquote>api.example.com</blockquote><p>The browser sends:</p><blockquote>SNI = api.example.com</blockquote><p>The ALB then selects the matching certificate and presents it.</p><p>Without SNI, the ALB would not know which certificate to use, resulting in hostname mismatch errors.</p><p>Think of SNI as:</p><blockquote><em>The certificate-selection mechanism for virtual hosting in HTTPS.</em></blockquote><p><strong>How ALPN Enables HTTP/2</strong></p><p>ALPN allows protocol negotiation inside TLS.</p><p>Browser:</p><blockquote>I support:</blockquote><blockquote>- h2</blockquote><blockquote>- http/1.1</blockquote><p>ALB:</p><blockquote>We’ll use:</blockquote><blockquote>- h2</blockquote><p>After TLS completion:</p><blockquote>HTTP/2 traffic flows</blockquote><p>If the ALB selects:</p><blockquote>http/1.1</blockquote><p>the connection continues using HTTP/1.1.</p><p>ALPN negotiates the application protocol but does <strong>not</strong> provide encryption. TLS already handles encryption.</p><p><strong>TLS 1.3 Handshake Flow</strong></p><p>TLS 1.3 significantly simplified the protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*loIfsFJdGnxjt1RzEH3P6w.png" /></figure><p>Key improvements over TLS 1.2:</p><ul><li>Fewer round trips</li><li>Faster connection setup</li><li>Removal of weak algorithms</li><li>More encrypted handshake data</li><li>Simpler key exchange process</li></ul><p><strong>TLS 1.2 Handshake Flow</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*bCAWr9sx_5cEw-QlYOtubw.png" /></figure><p>TLS 1.2 involves additional messages:</p><p>While secure, it requires more steps and higher latency than TLS 1.3.</p><p><strong>What Happens Between ALB and ECS Containers?</strong></p><p>After TLS terminates at the ALB, traffic is forwarded to ECS tasks.</p><p>There are two common deployment models.</p><p><strong>Option 1: TLS Termination at ALB (Most Common)</strong></p><p>Browser ── HTTPS ──► ALB ── HTTP ──► ECS</p><p>Characteristics:</p><ul><li>Browser traffic encrypted</li><li>Backend traffic plaintext</li><li>Communication remains inside AWS VPC</li></ul><p>This is the most frequently used architecture.</p><p><strong>Option 2: Re-Encryption to ECS Targets</strong></p><p>Browser ── HTTPS ──► ALB ── HTTPS ──► ECS</p><p>Characteristics:</p><ul><li>Encryption on both hops</li><li>Two separate TLS sessions</li><li>Additional security for compliance requirements</li></ul><p>Important:</p><p>The browser still validates only the ALB certificate.</p><p>The container certificate belongs to an entirely different TLS session between ALB and ECS.</p><p><strong>Who Validates What?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*dm5xps2Z7uIXVRS8B-b6ew.png" /></figure><p><strong>ACM Certificate Lifecycle</strong></p><p>Most AWS deployments use <strong>AWS Certificate Manager (ACM)</strong> certificates attached to ALB listeners.</p><p>Benefits include:</p><ul><li>Managed issuance</li><li>Automatic renewal</li><li>Integration with ALB</li><li>No manual certificate replacement</li></ul><p>When ACM renews a certificate, the ALB automatically begins serving the updated certificate without requiring application changes.</p><p>Client trust still depends on:</p><ul><li>Correct DNS configuration</li><li>Valid SAN entries</li><li>Trustworthy public CA chain</li></ul><p><strong>Common TLS Failures</strong></p><p><strong>Hostname Mismatch</strong></p><blockquote>Requested:app.example.com</blockquote><blockquote>Certificate:api.example.com</blockquote><p>Result:</p><blockquote>Certificate name mismatch</blockquote><p><strong>Expired Certificate</strong></p><blockquote>Not After date exceeded</blockquote><p>Result:</p><blockquote>Browser block or warning</blockquote><p><strong>Untrusted CA</strong></p><blockquote>Self-signed certificate</blockquote><blockquote>Result:</blockquote><blockquote>Certificate not trusted</blockquote><p><strong>TLS Policy Mismatch</strong></p><p>When the ALB disables older protocols:</p><blockquote>TLS 1.0</blockquote><blockquote>TLS 1.1</blockquote><p>Older clients may fail to connect.</p><p><strong>Revocation Issues</strong></p><p>If a certificate is revoked:</p><blockquote>OCSP/CRL validation fails</blockquote><p>Browsers may block or warn depending on policy.</p><p><strong>The Key Security Boundary</strong></p><p>The most important concept to remember is this:</p><blockquote><em>In an ECS Fargate + ALB architecture, the browser’s trust relationship terminates at the Application Load Balancer.</em></blockquote><p>The browser sends a <strong>ClientHello</strong>, the ALB replies with a <strong>ServerHello</strong>, presents its certificate chain, proves ownership of the private key, and completes the TLS handshake.</p><p>Only after successful validation does encrypted HTTP traffic begin.</p><p>Whether the ALB communicates with ECS containers using HTTP or HTTPS is an internal architectural decision and does not affect what the browser validates.</p><p>For organizations requiring stronger security guarantees:</p><ul><li>Use <strong>HTTPS target groups</strong> for end-to-end transport encryption.</li><li>Use <strong>mTLS-enabled service mesh solutions</strong> (such as App Mesh, Istio, or Linkerd) when workload identity verification is required.</li><li>Continue treating the <strong>ALB certificate as the public trust anchor</strong> for external clients.</li></ul><p><strong>In short:</strong> the browser trusts the ALB, not the container. The ALB is the TLS endpoint that establishes identity, negotiates encryption, and forms the public security boundary of your ECS Fargate application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5d2c4214a11" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>