File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Security and the fly likes http https switch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "http https switch" Watch "http https switch" New topic

http https switch

Kevin Kilbane
Ranch Hand

Joined: Sep 22, 2008
Posts: 42
Hi All,

I'm new to SSL so this may be a basic question.

I want to implement SSL on the login part of my application only (running on Tomcat). I've managed to get this working but can't get the application to switch back to non-SSL mode i.e. to http after the login screen. I've tried a few different things and had a good search on the web but can't find a solution.

At present, the application's web.xml looks like this:

I only want SSL security on the logon.html page. This works i.e. when the user gets to http://localhost:8080/myApp/logon.html he is re-directed to port 8443 and prompted to accept the certificate. However, after a successful login, as the user navigates through the application, the protocol is still https and he is still connecting through port 8443. I want it so that after he goes through the login process that he is directed back to port 8080 and is using the http protocol.

My understanding is that it should be possible to do this. Any help appreciated.

John Melton
Ranch Hand

Joined: Aug 17, 2004
Posts: 49
What you're seeing is that your confidential guarantee is doing it's job. It's redirecting on login, but there's no "not confidential" guarantee. So, the servlet container understands from your web.xml that it must redirect to https when login.html is accessed, but there's nothing to tell it to go back. However, if your login.html form goes to say ... /LoginServlet, you could redirect from there to http:// ... landingpage.jsp or something like that, and that should do the trick. In other words you have to tell it to go back to http once, but after that, everything will be relative.

I agree. Here's the link:
subject: http https switch
It's not a secret anymore!