my dog learned polymorphism*
The moose likes Tomcat and the fly likes SSL in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "SSL in Tomcat" Watch "SSL in Tomcat" New topic
Author

SSL in Tomcat

Rick Beaver
Ranch Hand

Joined: Dec 14, 2004
Posts: 464
Hi Ranchers

I am trying to enforce SSL on certain pages of my web application.

I am using Tomcat 4.something

I have SSL up and running fine but I have been unable to get the pages I want to only work in SSL to not be available on the normal http connection.

Lets say for example I wanted everything in /secure dir to use SSL exclusively how would I do that?

Cheers

Nick


ph34r my 133t j4v4 h4><0r1ng sk177z
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
Here's one way you can do it without being tomcat specific.
In your JSP:
<% if (!request.isSecure())
{ %>
Sorry, this webpage is only available over a secure connection. (possibly provide a link to it?)
<% } %>


Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
 
wood burning stoves
 
subject: SSL in Tomcat
 
Similar Threads
Using SSL with JSP pages
Struts, SSL, and converting between them
How to implement SSL when running Tomcat behind Apache
SSL
When using IIS & Tomcat, should I install ssl on IIS or tomcat?