You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Greg Brownell <gw...@technologist.com> on 2005/10/21 16:13:40 UTC

SSL and Tomcat - can't secure individula pages

All,

My whole site, all pages, are redirected to port 443 - everything is 
secure.  I only wanted the *.htm and the single file login.jsp to use 
https.

I have set up tomcat 5.5.9 with SSL as follows:

server.xml:


   <!-- Define a non-SSL HTTP/1.1 Connector on port (8080 changed to 
9123 -->
   <Connector port="80" maxHttpHeaderSize="8192"
              maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
              enableLookups="false" redirectPort="443" acceptCount="100"
              connectionTimeout="20000" disableUploadTimeout="true" />

   <!-- Define a SSL HTTP/1.1 Connector on port 443 -->
   <Connector port="443" maxHttpHeaderSize="8192"
              maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
              enableLookups="false" disableUploadTimeout="true"
              acceptCount="100" scheme="https" secure="true"
               keystoreFile="/etc/.keystore"
               keystorePass="xxxxxxxx"
              clientAuth="false" sslProtocol="TLS" />

and web.xml:

<security-constraint>
     <web-resource-collection>
       <web-resource-name>secure pages</web-resource-name>
       <url-pattern>*.htm</url-pattern>
     </web-resource-collection>
     <web-resource-collection>
       <web-resource-name>secure pages</web-resource-name>
       <url-pattern>/login.jsp</url-pattern>
     </web-resource-collection>
     <user-data-constraint>
       <transport-guarantee>CONFIDENTIAL</transport-guarantee>
     </user-data-constraint>
</security-constraint>
</web-app>


What am I doing wrong? I thought the <web-resource-collection> in 
<security-constraint> was there to identify which pages should be secure?

Thanks.

Greg.

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


Re: SSL and Tomcat - can't secure individula pages

Posted by Hassan Schroeder <ha...@webtuitive.com>.
Greg Brownell wrote:

> My whole site, all pages, are redirected to port 443 - everything is
> secure.  I only wanted the *.htm and the single file login.jsp to use
> https.

> What am I doing wrong? I thought the <web-resource-collection> in
> <security-constraint> was there to identify which pages should be secure?

which pages *must* be secure -- other pages *may* be served securely.

If you are using URLs in your secure *.htm pages that don't specify
the protocol, e.g.,

  <a href="/nonsecure.jsp">go</a>

and that page is accessed via HTTPS, the actual URL is

  https://example.com/nonsecure.jsp

If you want it served as `http://example.com/nonsecure.jsp`, you'll
have to be more explicit about that URL...  :-)

HTH,
-- 
Hassan Schroeder ----------------------------- hassan@webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                          dream.  code.



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