hi all,
I have used
Tomcat in several projects, using both SSL and non-SSL connectors. I have a problem that I hope someone could help.
Say I have a
servlet with context at "/management". It has 2 connectors, a non-SSL on port 8080 and a SSL on port 8443. All works fine, i.e. I can get to it either using "https://localhost:8443/management" or "http://localhost:8080/management".
My problem is that, say, a user happens to type in a wrong protocol to a wrong port, i.e. "
https://localhost:
8080/management" or "
http://localhost:
8443/management".
In the first case, the browser (IE) would eventually display "Internet Explorer cannot display the webpage", which is expected.
In the latter case, the browser displays a blank page with 5 small squares, like " "... making it very confusing to the user.
Do you guys know how to handle this more gracefully? I looked into Tomcat source and it tries to to ssl-handshake for the HTTP messaging coming in. Of course that fails, so it will close the connection. Those are all fine, but how come the browser does not display "Internet Explorer cannot display the webpage" like the other case?
Another option would be, somehow forwarding "http://localhost:8443/management" to "
https://localhost:8443/management"... How?
Thank for you suggestions and help.
Henry
BTW, I think this happens to early so writing a Filter doesn't help. Using <security-constraint> in web.xml is not an option either because we
must be able to handle both HTTP and HTTPS for the same resource, just different ports.