Question

Application is not redirecting to HTTPS

Posted April 29, 2020 650 views
APILoad Balancing

Hi,

I have deployed JAVA Application on Tomcat Server in the droplet IP address.

I have created new SSL certificate from Godaddy and applied. Set forwarding to HTTPS 443 rule and droplet HTTP 8080 post.

Both the load balancer and droplets status are healthy.

My application is running at port 8080.

Also, I enabled force HTTPS settings in the load balancer settings.

But my Java application still runs on HTTP port. Not redirected HTTPS.

I have added IP address as ‘A’ in GoDaddy and domain settings of DigitalOcean.

Please let me know how to solve this issue.

Thanks

Nitin C N

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi @kiran306 ,

Can you use HTTPS service normally?If your answer is yes,maybe the following steps can help you config HTTPS force.

#add these after tomcat\conf\web.xml </welcome-file-list>

<login-config>
  <!-- Authorization setting for SSL -->
    <auth-method>CLIENT-CERT</auth-method>
    <realm-name>Client Cert Users-only Area</realm-name>
</login-config>

<security-constraint>
  <!-- Authorization setting for SSL -->
    <web-resource-collection >
        <web-resource-name >SSL</web-resource-name>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

Finally it should be like this:

Please use ports that support HTTPS protocol if you only have one,don’t set it to redirect.In this time you should directly type in https://IPAddr or Domain name:port

Let me know if you have further questions,
Shiroka