This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Security and the fly likes http https switch Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » Security
Reply Bookmark "http https switch" Watch "http https switch" New topic
Author

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.

Thnaks.
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.


[url]www.jtmelton.com[/url]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: http https switch
 
Similar Threads
HttpServletRequest - RequestDispatcher - Forward - is not using Constraint
Can�t get SSL redirection to work for root application context.
why my login page is not using SSL?
Tomcat filters
Transport-guarantee in web.xml