I am having some problem with SSL, Load Balancer and Tomcat. I have a tomcat instance, running on 8080 port, which is accessible and working perfectly. My application is on SPRING framework and it switches to HTTPS for some secure pages [like account/checkout etc.] The secure port running on tomcat is 8443. For a standalone tomcat server, everything is working as expected, switching between secure and non-secure pages is working fine.
My GOAL: I want the load balancer to handle all the SSL stuff, so that i wont have to configure SSL on individual tomcat servers.
WHAT I DID: I purchased an SSL certificate, and configured the certificate on a AWS Elastic Load Balancer, and added my tomcat instance. My Listeners are configured this way:- 1. HTTP 80 -> HTTP 8080 2. HTTPS 443 -> HTTP 8443 [added SSL certificate to load-balancer here]
TOMCAT 8080 port configuration
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
Now, i am able to access my application by using load balancer.
THE PROBLEM: When i go to secure pages, the application is not functioning as expected. I have tried the below tomcat configuration, and i can access the secure pages, but the session is getting invalidated. Any pointers on what i am missing here?
<Connector
port="8443"
sslProtocol="HTTP/1.1"
scheme="https"
secure="true"
connectionTimeout="20000"
URIEncoding="UTF-8"
proxyPort="443"
/>