0

Hi I have the following connector in my apache tomcat server in the file server.xml:

 <Connector port="8443" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               secure="true"
               SSLEnabled="true"
               scheme="https"
               keystoreFile="/opt/tomcat/resources/keystore.jks"
               keystorePass="secret"
               clientAuth="false"
               sslProtocol="TLS"
    />

If you visit the Site via the url https://mysite:8443/webapp I get a secure TLS Connection and everything works.

But some of my coworkers manually type http://mysite:8443/webapp and get the error:

Bad Request This combination of host and port requires TLS.

This error makes sense to me. But I need that if you make a HTTP Request on the Port 8443 that this Request gets redirected to a HTTPS Request. So that I user can Type HTTP and will get redirected to HTTPS automatically.

Is there a way to achieve this behavior in Apache Tomcat/9.0.73.

  • 1
    Does this answer your question? [Apache answer both HTTP and HTTPS on the same port](https://serverfault.com/questions/359461/apache-answer-both-http-and-https-on-the-same-port) – vidarlo Mar 24 '23 at 13:21

0 Answers0