You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Roth <jo...@providersolutions.net> on 2002/06/07 17:09:27 UTC

Redirect port 80 requests to 443

This seems simple, but ...

I am running Tomcat 4.0.3, standalone on w2k.  I would like all requests to
http://oursite/ to be automatically redirected to https://oursite/ but am
not finding an elegant/simple solution.  Below is a snippet from server.xml:

<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="80" minProcessors="2" redirectPort="443" maxProcessors="15"
enableLookups="false" acceptCount="10"/>
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="443" minProcessors="2" maxProcessors="15" enableLookups="false"
acceptCount="10" scheme="https" secure="true">
      <Factory className="org.apache.catalina.net.SSLServerSocketFactory"
keystoreFile="***********.keystore" keystorePass="*********"
clientAuth="false" protocol="TLS"/>
      </Connector>

Any ideas/pointers?

Thanks,
John Roth, Director net.Media
Provider Solutions Corp.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Redirect port 80 requests to 443

Posted by Rick Fincher <rn...@tbird.com>.
Hi John,

Tomcat will do this automatically with your app but it has to know that it
is meant for the secure port only.  You tell it this by including something
like the following in your web.xml for the app.

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

Rick

----- Original Message -----
From: "John Roth" <jo...@providersolutions.net>

> This seems simple, but ...
>
> I am running Tomcat 4.0.3, standalone on w2k.  I would like all requests
to
> http://oursite/ to be automatically redirected to https://oursite/ but am
> not finding an elegant/simple solution.  Below is a snippet from
server.xml:
>
> <Connector className="org.apache.catalina.connector.http.HttpConnector"
> port="80" minProcessors="2" redirectPort="443" maxProcessors="15"
> enableLookups="false" acceptCount="10"/>
> <Connector className="org.apache.catalina.connector.http.HttpConnector"
> port="443" minProcessors="2" maxProcessors="15" enableLookups="false"
> acceptCount="10" scheme="https" secure="true">
>       <Factory className="org.apache.catalina.net.SSLServerSocketFactory"
> keystoreFile="***********.keystore" keystorePass="*********"
> clientAuth="false" protocol="TLS"/>
>       </Connector>
>
> Any ideas/pointers?
>
> Thanks,
> John Roth, Director net.Media
> Provider Solutions Corp.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>