title: AWS ALB - Secure Web Sockets + Spring Boot
body: <p><strong>Environment Setup:</strong></p>
  <p>I have a Spring Boot application behind an AWS ALB (Application Load Balancer). The ALB is configured to front HTTPs to the world with a Spring boot application as a target running on HTTP.</p>
  <p><strong>Connection Diagram:</strong></p>
  <p>HTTPS 443 -&gt; ALB -&gt; HTTP 8080 -&gt; Spring Boot</p>
  <p><strong>The Problem:</strong></p>
  <p>As the application is running on HTTP internally (8080) but is served on HTTPs via the load balancer I'm unable to use ws://example.com protocol t due to MIXED content restrictions in the browser. I also cannot use 'wss://example.com' as the end server (Spring Boot) is running over HTTP is does not accept the connection.</p>
  <p><strong>The Question:</strong></p>
  <p>The only solution I have found is to move the end application to use HTTPs with a self-signed certificate. Is there an alternative solution thereby keeping the application running on HTTP but to accept the WSS connection?</p>