Thursday, November 27, 2008

Tomcat and SSL redirection

*GEEK POST*

As an addendum to the previous post, further configuration of the server.xml and web.xml is necessary. Setting of the redirectPort="443" (or whatever port number your https is on) in the server.xml requires additional setting in web.xml of your application.

<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Context</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<!-- auth-constraint goes here if you requre authentication -->
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

Further info here.

No comments: