Well, not a configuration, you could write and register a filter that sends a re-direct.

You have to do something similar to this (but in reverse):
https://stackoverflow.com/questions/9389211/using-filters-to-redirect-from-https-to-http

On 10/5/2018 3:23 PM, Gillett, Phil wrote:
Hello:
   Perfect timing!!
   I've been assigned at my job to apply something similar with Tomcat and 
Footprints 12, and have had some issues.
   I hope someone has a solution, and I thank you in advance!

Phil G.

-----Original Message-----
From: ettra lancelot <ettra...@gmail.com>
Sent: Friday, October 5, 2018 1:57 PM
To: users@tomcat.apache.org
Subject: Redirecting to https URL when https port is accessed with http scheme

Hi,

I would like to know whether it's possible to configure tomcat to automatically 
redirect to the https URL when https port is access using http scheme instead 
of https*.*

For example, say I have configured an ssl connector on port 8443, if I access 
the connector using http scheme (eg: http://localhost:8443) instead of using 
https scheme, I'm receiving some meaningless characters  (refer [1]). Instead, 
is it possible to make an automatic redirection to the https url (eg: 
https://localhost:8443) ?

Few details about the setup.

- Tomcat version - 7.0.85
- SSL connector is configure on port 8443

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
                scheme="https" secure="true"
                clientAuth="false" sslProtocol="TLS"
                keystoreFile="conf/keystore" keystorePass="xxx"/>

- Added the following security-constrain to web.xml

     <security-constraint>
         <web-resource-collection>
             <web-resource-name>HTTPSOnly</web-resource-name>
             <url-pattern>/*</url-pattern>
         </web-resource-collection>
         <user-data-constraint>
             <transport-guarantee>CONFIDENTIAL</transport-guarantee>
         </user-data-constraint>
     </security-constraint>

[1] - https://i.stack.imgur.com/1LVq7.png

Thank you,
Etcy.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to