1 5 6 package com.sun.enterprise.tools.admingui.servlet; 7 8 import java.io.*; 9 import javax.servlet.*; 10 import javax.servlet.http.*; 11 import java.security.NoSuchAlgorithmException ; 12 import java.security.KeyManagementException ; 13 14 import com.sun.enterprise.tools.admingui.util.JSSE; 15 16 public final class HelpWindowFilter implements Filter { 17 18 private FilterConfig filterConfig = null; 19 20 public void init(FilterConfig filterConfig) throws ServletException { 21 this.filterConfig = filterConfig; 22 } 23 24 public void destroy() { 25 this.filterConfig = null; 26 } 27 public void doFilter(ServletRequest request, ServletResponse response, 28 FilterChain chain) throws IOException, ServletException { 29 30 if (filterConfig == null) { 31 return; 32 } 33 if(!request.isSecure()) { 34 chain.doFilter(request, response); 35 return; 36 } 37 try { 38 JSSE.trustAnyServerCertificate(); 39 } 40 catch(KeyManagementException ex) { 41 ex.printStackTrace(); 43 } 44 catch(NoSuchAlgorithmException ex) { 45 ex.printStackTrace(); 47 } 48 49 chain.doFilter(request, response); 50 } 51 52 } 53 54 | Popular Tags |