Java Servlet Filters and SSL
Do Servlet filters have any issues with detecting SSL requests?
I have a filter that works okay with norm开发者_如何学Cal http request but it does not detect https request.
Any advice here would be appreciated.
Do Servlet filters have any issues with detecting SSL requests?
AFAIK no.
Any advice here would be appreciated.
Check that your web container is configured to listen for HTTPS requests. For Tomcat, check the "connector" elements in your "server.xml" file.
I have a servlet filter that works with both SSL and non-SSL connections, and I can determine whether the connection is SSL or not by invoking the method HttpServletRequest.isSecure(). So this should work, once SSL is configured properly in the container (and that is usually the tricky part). Check the configuration against the documentation for setting up SSL for your container, and look in that documentation for an option to enable SSL debugging; that should help identify what is going wrong.
精彩评论