I have problems getting HTTP to HTTPS redirect to work in my Tomcat.
in Server.xml I have the connectors
<Connector port="8080" protocol="HTTP/1.1" redirectPort="8443" />
<Connector port="8443" maxHttpHeaderSize="8192" maxThreads="100"
minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
SSLEnabled="true" clientAuth="false"
sslProtocol="TLS" keyAlias="some_alias"
keystoreFile="secret-keystore-files"
keystorePass="Supersafepassword" />
and in 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>
HTTPS works fine with no certificate issues, but when I access http://server:8080 I get redirected to https://server:8080 (same port) and not 8443 as expected.